Skip to content

Commit 58ec2f7

Browse files
Merge pull request saltstack#3 from scriptautomate-bc/devcontainer-contrib-updates
Add devcontainer and enable GHA
2 parents 5edf38b + 06e854b commit 58ec2f7

File tree

11 files changed

+150
-160
lines changed

11 files changed

+150
-160
lines changed

.devcontainer/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM bitnami/python:3.13
2+
3+
RUN apt update && apt upgrade -y
4+
5+
# Add dev requirements
6+
ADD requirements.txt /tmp/
7+
RUN pip3 install -r /tmp/requirements.txt
8+
RUN rm /tmp/requirements.txt

.devcontainer/devcontainer.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
{
3+
"name": "salt-user-guide",
4+
5+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
6+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
7+
// Python container image is needed for running python-based tests (ex. orphaned-content.py)
8+
// "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm",
9+
10+
"build": {
11+
"dockerfile": "Dockerfile"
12+
},
13+
14+
// Features to add to the dev container. More info: https://containers.dev/features.
15+
// "features": {
16+
// node / npm is required for markdownlint-cli2
17+
// By default, installs lts version
18+
// "ghcr.io/devcontainers/features/node:1": {}
19+
// },
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
// "postCreateCommand": ""
26+
27+
// There is also a postStartCommand that executes every time the container starts.
28+
// The parameters behave exactly like postCreateCommand, but the commands execute on start rather than create.
29+
// "postStartCommand": ""
30+
31+
// There is also a postAttachCommand that executes every time the container attaches to a workspace.
32+
// The parameters behave exactly like postCreateCommand, but the commands execute on a started container after the workspace is available under /workspaces/
33+
// "postAttachCommand": {},
34+
35+
// Configure tool-specific properties.
36+
"customizations": {
37+
// Configure properties specific to VS Code.
38+
"vscode": {
39+
// Add the IDs of extensions you want installed when the container is created.
40+
"extensions": [
41+
// Extension to work with Python
42+
"ms-python.python"
43+
]
44+
}
45+
}
46+
47+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
48+
// "remoteUser": "root"
49+
}
File renamed without changes.
+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Workflow for building a Sphinx site and deploying artifacts to GitHub Releases
2+
name: Build Sphinx docs
3+
4+
on:
5+
push: {}
6+
pull_request: {}
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Default to bash
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
24+
build:
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Setup Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.13'
33+
cache: pip
34+
- name: Run pre-commit
35+
run: |
36+
pip install -U pip setuptools wheel
37+
pip install -r .devcontainer/requirements.txt
38+
pre-commit install
39+
pre-commit run -a -v --color always
40+
- name: Build docs
41+
run: |
42+
nox -e 'docs-html(gen_sitevars=True, clean=True)'
43+
- name: Upload artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: salt-user-guide
47+
path: ./docs/_build/html/
48+
if-no-files-found: error
49+
retention-days: 1
50+
51+
# Release job
52+
deploy:
53+
permissions:
54+
contents: write
55+
runs-on: ubuntu-24.04
56+
needs:
57+
- build
58+
if: success() && startsWith(github.ref, 'refs/tags/')
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
- name: Download artifacts
63+
uses: actions/download-artifact@v4
64+
- name: Display all downloaded archives/artifacts
65+
run: |
66+
ls -lah
67+
68+
echo "
69+
Listing salt-user-guide/*..."
70+
ls -lah salt-user-guide/*
71+
72+
echo "
73+
Creating archive of built salt-user-guide..."
74+
tar cvfz salt-user-guide.tar.gz salt-user-guide
75+
76+
echo "
77+
Creating checksums.txt..."
78+
sha512sum salt-user-guide.tar.gz salt.repo salt.sources | tee checksums.txt
79+
80+
- name: Release
81+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
82+
with:
83+
files: |
84+
checksums.txt
85+
salt-user-guide.tar.gz

.gitlab-ci.yml

-62
This file was deleted.

.gitlab/issue_templates/documentation-bug-report.md

-15
This file was deleted.

.gitlab/merge_request_templates/salt-user-guide-merge-request.md

-32
This file was deleted.

.pre-commit-config.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
minimum_pre_commit_version: 2.9.3
2+
minimum_pre_commit_version: 4.2.0
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.0.1
5+
rev: v5.0.0
66
hooks:
77
- id: check-merge-conflict
88
description: Check for files that contain merge conflict strings.
@@ -29,19 +29,19 @@ repos:
2929
You must provide list of target files as input in your .pre-commit-config.yaml file.
3030
files: ^(.*requirements.*\.txt|\.brokignore|sitevars.rst)$
3131
- repo: https://github.com/timothycrosley/isort
32-
rev: "5.11.5"
32+
rev: "6.0.1"
3333
hooks:
3434
- id: isort
3535
description: isort is a Python utility / library to sort imports automatically.
3636
files: ^((noxfile|conf)|docs/_includes/python/.*)\.py$
3737
- repo: https://github.com/psf/black
38-
rev: 22.3.0
38+
rev: 25.1.0
3939
hooks:
4040
- id: black
4141
description: Forces best practice formatting of Python code files.
4242
files: ^((noxfile|conf)|docs/_includes/python/.*)\.py$
4343
- repo: https://github.com/myint/rstcheck
44-
rev: 3f92957 # Latest as of 05/17/2020
44+
rev: v6.2.4 # Latest as of 05/17/2020
4545
hooks:
4646
- id: rstcheck
4747
description: Checks syntax of reStructuredText/rst and code blocks nested within it.
@@ -50,12 +50,12 @@ repos:
5050
files: ^(index|docs/.*|docs/_includes/.*|README|CONTRIBUTING)\.rst$
5151
exclude: docs/topics/pillar.rst
5252
- repo: https://github.com/asottile/blacken-docs
53-
rev: v1.10.0
53+
rev: 1.19.1
5454
hooks:
5555
- id: blacken-docs
5656
description: Run black on python code blocks in documentation files.
5757
files: ^(index|docs/.*|docs/_includes/.*)\.rst$
58-
additional_dependencies: [black==21.8b0]
58+
additional_dependencies: [black==25.1.0]
5959
# - repo: local
6060
# hooks:
6161
# - id: vendir
@@ -72,7 +72,7 @@ repos:
7272
# language: system
7373
# files: ^(index|docs/.*|docs/_includes/.*|README|CONTRIBUTING)\.rst$
7474
- repo: https://github.com/saltstack/mirrors-nox
75-
rev: v2022.8.7
75+
rev: v2022.11.21
7676
hooks:
7777
- id: nox
7878
alias: Generate Sphinx docs

.rstcheck.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ ignore_directives=
1111
tab-set,
1212
ignore_substitutions=
1313
release,
14-
ignore_messages=(.*(aix|arista)\.rst.* \(ERROR\/3\) Error in "code-block" directive\:$)

.vale.ini

-13
This file was deleted.

vendir.yml

-29
This file was deleted.

0 commit comments

Comments
 (0)