occystrap 0.4.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- occystrap-0.4.1/.github/actionlint.yaml +24 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/.github/workflows/codeql-analysis.yml +12 -7
- occystrap-0.4.1/.github/workflows/export-repo-config.yml +14 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/.github/workflows/functional-tests.yml +41 -14
- occystrap-0.4.1/.github/workflows/pr-re-review.yml +73 -0
- occystrap-0.4.1/.github/workflows/python-unit-tests.yml +36 -0
- occystrap-0.4.1/.github/workflows/release.yml +142 -0
- occystrap-0.4.1/.github/workflows/renovate.yml +24 -0
- occystrap-0.4.1/.gitignore +49 -0
- occystrap-0.4.1/.pre-commit-config.yaml +30 -0
- occystrap-0.4.1/.shellcheckrc +133 -0
- occystrap-0.4.1/.stestr.conf +3 -0
- occystrap-0.4.1/AGENTS.md +91 -0
- occystrap-0.4.1/ARCHITECTURE.md +210 -0
- occystrap-0.4.1/CLAUDE.md +85 -0
- occystrap-0.4.1/IMAGE_STORES.md +185 -0
- occystrap-0.4.1/PKG-INFO +444 -0
- occystrap-0.4.1/README.md +413 -0
- occystrap-0.4.1/RELEASE-SETUP.md +161 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/occystrap_ci/tests/test_dir_deep_images.py +3 -3
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_docker_input.py +274 -0
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_docker_output.py +234 -0
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_exclude_filter.py +308 -0
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_filter_chaining.py +406 -0
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_inspect_filter.py +612 -0
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_normalize_timestamps.py +159 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/occystrap_ci/tests/test_oci_hello_world.py +3 -3
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_registry_output.py +337 -0
- occystrap-0.4.1/deploy/occystrap_ci/tests/test_search_layers.py +214 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/occystrap_ci/tests/test_whiteout.py +5 -5
- occystrap-0.4.1/deploy/test-requirements.txt +2 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/tox.ini +1 -1
- occystrap-0.4.1/docs/command-reference.md +398 -0
- occystrap-0.4.1/docs/index.md +90 -0
- occystrap-0.4.1/docs/installation.md +133 -0
- occystrap-0.4.1/docs/pipeline.md +265 -0
- occystrap-0.4.1/docs/tar-format-selection.md +142 -0
- occystrap-0.4.1/docs/use-cases.md +314 -0
- occystrap-0.4.1/occystrap/_version.py +34 -0
- occystrap-0.4.1/occystrap/filters/__init__.py +10 -0
- occystrap-0.4.1/occystrap/filters/base.py +67 -0
- occystrap-0.4.1/occystrap/filters/exclude.py +136 -0
- occystrap-0.4.1/occystrap/filters/inspect.py +179 -0
- occystrap-0.4.1/occystrap/filters/normalize_timestamps.py +123 -0
- occystrap-0.4.1/occystrap/filters/search.py +177 -0
- occystrap-0.4.1/occystrap/inputs/__init__.py +1 -0
- occystrap-0.4.1/occystrap/inputs/base.py +40 -0
- occystrap-0.4.1/occystrap/inputs/docker.py +171 -0
- occystrap-0.4.0/occystrap/docker_registry.py → occystrap-0.4.1/occystrap/inputs/registry.py +112 -50
- occystrap-0.4.1/occystrap/inputs/tarfile.py +88 -0
- occystrap-0.4.1/occystrap/main.py +436 -0
- occystrap-0.4.1/occystrap/outputs/__init__.py +1 -0
- occystrap-0.4.1/occystrap/outputs/base.py +46 -0
- occystrap-0.4.0/occystrap/output_directory.py → occystrap-0.4.1/occystrap/outputs/directory.py +10 -9
- occystrap-0.4.1/occystrap/outputs/docker.py +137 -0
- occystrap-0.4.0/occystrap/output_mounts.py → occystrap-0.4.1/occystrap/outputs/mounts.py +2 -1
- occystrap-0.4.0/occystrap/output_ocibundle.py → occystrap-0.4.1/occystrap/outputs/ocibundle.py +1 -1
- occystrap-0.4.1/occystrap/outputs/registry.py +240 -0
- occystrap-0.4.0/occystrap/output_tarfile.py → occystrap-0.4.1/occystrap/outputs/tarfile.py +18 -2
- occystrap-0.4.1/occystrap/pipeline.py +297 -0
- occystrap-0.4.1/occystrap/tarformat.py +122 -0
- occystrap-0.4.1/occystrap/tests/test_inspect.py +355 -0
- occystrap-0.4.1/occystrap/tests/test_tarformat.py +199 -0
- occystrap-0.4.1/occystrap/uri.py +231 -0
- occystrap-0.4.1/occystrap/util.py +113 -0
- occystrap-0.4.1/occystrap.egg-info/PKG-INFO +444 -0
- occystrap-0.4.1/occystrap.egg-info/SOURCES.txt +88 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap.egg-info/entry_points.txt +0 -1
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap.egg-info/requires.txt +10 -3
- occystrap-0.4.1/pyproject.toml +65 -0
- occystrap-0.4.1/renovate.json +24 -0
- occystrap-0.4.1/setup.cfg +4 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/tools/flake8wrap.sh +1 -1
- {occystrap-0.4.0 → occystrap-0.4.1}/tox.ini +10 -7
- occystrap-0.4.0/.github/workflows/python-unit-tests.yml +0 -33
- occystrap-0.4.0/PKG-INFO +0 -123
- occystrap-0.4.0/README.md +0 -104
- occystrap-0.4.0/deploy/test-requirements.txt +0 -2
- occystrap-0.4.0/occystrap/docker_extract.py +0 -36
- occystrap-0.4.0/occystrap/main.py +0 -137
- occystrap-0.4.0/occystrap/util.py +0 -84
- occystrap-0.4.0/occystrap.egg-info/PKG-INFO +0 -123
- occystrap-0.4.0/occystrap.egg-info/SOURCES.txt +0 -46
- occystrap-0.4.0/occystrap.egg-info/not-zip-safe +0 -1
- occystrap-0.4.0/occystrap.egg-info/pbr.json +0 -1
- occystrap-0.4.0/release.sh +0 -44
- occystrap-0.4.0/requirements.txt +0 -6
- occystrap-0.4.0/setup.cfg +0 -32
- occystrap-0.4.0/setup.py +0 -29
- occystrap-0.4.0/test-requirements.txt +0 -5
- {occystrap-0.4.0 → occystrap-0.4.1}/AUTHORS +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/LICENSE +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/.stestr.conf +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/ansible/ci.yml +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/occystrap_ci/__init__.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/occystrap_ci/testdata/deletion_layers/Dockerfile +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/occystrap_ci/tests/__init__.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/requirements.txt +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/setup.cfg +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/deploy/setup.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap/__init__.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap/common.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap/constants.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap/tests/__init__.py +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap.egg-info/dependency_links.txt +0 -0
- {occystrap-0.4.0 → occystrap-0.4.1}/occystrap.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Configuration for actionlint
|
|
2
|
+
# https://github.com/rhysd/actionlint/blob/main/docs/config.md
|
|
3
|
+
|
|
4
|
+
self-hosted-runner:
|
|
5
|
+
# Custom labels used by our self-hosted runners
|
|
6
|
+
labels:
|
|
7
|
+
- vm
|
|
8
|
+
- debian-12
|
|
9
|
+
- xl
|
|
10
|
+
- m
|
|
11
|
+
- s
|
|
12
|
+
- claude-code
|
|
13
|
+
- static
|
|
14
|
+
|
|
15
|
+
# Ignore certain shellcheck rules from run: blocks in workflow files.
|
|
16
|
+
# These are overly pedantic for CI workflow scripts where the inputs are
|
|
17
|
+
# controlled by GitHub Actions expressions.
|
|
18
|
+
paths:
|
|
19
|
+
.github/workflows/*.yml:
|
|
20
|
+
ignore:
|
|
21
|
+
- 'SC1090:' # Can't follow non-constant source
|
|
22
|
+
- 'SC2046:' # Quote command substitution to prevent word splitting
|
|
23
|
+
- 'SC2086:' # Double quote to prevent globbing and word splitting
|
|
24
|
+
- 'SC2143:' # Use grep -q instead of comparing output with [ -n .. ]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
name: "CodeQL"
|
|
2
2
|
|
|
3
|
+
permissions: {}
|
|
4
|
+
|
|
3
5
|
on:
|
|
4
6
|
push:
|
|
5
7
|
branches: [master, ]
|
|
@@ -13,10 +15,13 @@ jobs:
|
|
|
13
15
|
analyze:
|
|
14
16
|
name: Analyze
|
|
15
17
|
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
security-events: write
|
|
16
21
|
|
|
17
22
|
steps:
|
|
18
23
|
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@
|
|
24
|
+
uses: actions/checkout@v4
|
|
20
25
|
with:
|
|
21
26
|
# We must fetch at least the immediate parents so that if this is
|
|
22
27
|
# a pull request then we can checkout the head.
|
|
@@ -29,7 +34,7 @@ jobs:
|
|
|
29
34
|
|
|
30
35
|
# Initializes the CodeQL tools for scanning.
|
|
31
36
|
- name: Initialize CodeQL
|
|
32
|
-
uses: github/codeql-action/init@
|
|
37
|
+
uses: github/codeql-action/init@v3
|
|
33
38
|
# Override language selection by uncommenting this and choosing your languages
|
|
34
39
|
# with:
|
|
35
40
|
# languages: go, javascript, csharp, python, cpp, java
|
|
@@ -37,12 +42,12 @@ jobs:
|
|
|
37
42
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
38
43
|
# If this step fails, then you should remove it and run the build manually (see below)
|
|
39
44
|
- name: Autobuild
|
|
40
|
-
uses: github/codeql-action/autobuild@
|
|
45
|
+
uses: github/codeql-action/autobuild@v3
|
|
41
46
|
|
|
42
|
-
#
|
|
43
|
-
#
|
|
47
|
+
# Command-line programs to run using the OS shell.
|
|
48
|
+
# https://git.io/JvXDl
|
|
44
49
|
|
|
45
|
-
#
|
|
50
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines
|
|
46
51
|
# and modify them (or add more) to build your code if your project
|
|
47
52
|
# uses a compiled language
|
|
48
53
|
|
|
@@ -51,4 +56,4 @@ jobs:
|
|
|
51
56
|
# make release
|
|
52
57
|
|
|
53
58
|
- name: Perform CodeQL Analysis
|
|
54
|
-
uses: github/codeql-action/analyze@
|
|
59
|
+
uses: github/codeql-action/analyze@v3
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: Export repository configuration
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: '30 00 * * *'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
export-config:
|
|
13
|
+
uses: shakenfist/actions/.github/workflows/export-repo-config.yml@main
|
|
14
|
+
secrets: inherit
|
|
@@ -8,9 +8,12 @@ on:
|
|
|
8
8
|
branches:
|
|
9
9
|
- master
|
|
10
10
|
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
11
14
|
jobs:
|
|
12
15
|
functional:
|
|
13
|
-
runs-on: self-hosted
|
|
16
|
+
runs-on: [self-hosted, vm, debian-12]
|
|
14
17
|
timeout-minutes: 120
|
|
15
18
|
|
|
16
19
|
# NOTE(mikal): git repos are checked out to /srv/github/_work/{repo}/{repo}
|
|
@@ -44,36 +47,60 @@ jobs:
|
|
|
44
47
|
sudo ls -l /var/run/docker.sock
|
|
45
48
|
|
|
46
49
|
- name: Checkout occystrap
|
|
47
|
-
uses: actions/checkout@
|
|
50
|
+
uses: actions/checkout@v4
|
|
48
51
|
with:
|
|
49
|
-
path: occystrap
|
|
50
52
|
fetch-depth: 0
|
|
51
53
|
|
|
52
|
-
- name: Build occystrap wheel and install it
|
|
54
|
+
- name: Build occystrap wheel and install it in a venv
|
|
53
55
|
run: |
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
python3
|
|
57
|
-
|
|
56
|
+
python3 -mvenv ~/occystrap-venv
|
|
57
|
+
~/occystrap-venv/bin/pip3 install build
|
|
58
|
+
~/occystrap-venv/bin/python3 -m build
|
|
59
|
+
~/occystrap-venv/bin/pip3 install dist/occystrap*.whl
|
|
58
60
|
|
|
59
61
|
- name: Run a local docker registry to talk to, and populate it with test data
|
|
60
62
|
run: |
|
|
61
63
|
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
|
62
|
-
cd
|
|
64
|
+
cd deploy/occystrap_ci/testdata
|
|
65
|
+
start_dir=$(pwd)
|
|
63
66
|
|
|
64
67
|
for img in deletion_layers; do
|
|
65
68
|
cd $img
|
|
66
69
|
docker build -t localhost:5000/occystrap_$img:latest .
|
|
67
70
|
docker push localhost:5000/occystrap_$img:latest
|
|
68
|
-
cd
|
|
71
|
+
cd ${start_dir}
|
|
69
72
|
done
|
|
70
73
|
|
|
71
74
|
- name: Run functional tests
|
|
72
75
|
run: |
|
|
73
|
-
cd
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
cd deploy
|
|
77
|
+
. ~/occystrap-venv/bin/activate
|
|
78
|
+
pip3 install -r requirements.txt
|
|
79
|
+
pip3 install -r test-requirements.txt
|
|
76
80
|
|
|
77
81
|
# This needs to run as root because some of the tests require
|
|
78
82
|
# escalated permissions.
|
|
79
|
-
sudo stestr run --concurrency=5
|
|
83
|
+
sudo /home/debian/occystrap-venv/bin/stestr run --concurrency=5
|
|
84
|
+
|
|
85
|
+
automated_reviewer:
|
|
86
|
+
name: "Automated reviewer"
|
|
87
|
+
permissions:
|
|
88
|
+
contents: read
|
|
89
|
+
pull-requests: write
|
|
90
|
+
runs-on: [self-hosted, claude-code]
|
|
91
|
+
needs: [functional]
|
|
92
|
+
if: github.event_name == 'pull_request'
|
|
93
|
+
concurrency:
|
|
94
|
+
group: ${{ github.workflow }}-${{ github.ref }}-reviewer
|
|
95
|
+
cancel-in-progress: true
|
|
96
|
+
|
|
97
|
+
steps:
|
|
98
|
+
- name: Checkout code
|
|
99
|
+
uses: actions/checkout@v4
|
|
100
|
+
with:
|
|
101
|
+
fetch-depth: 0
|
|
102
|
+
|
|
103
|
+
- name: Run automated reviewer
|
|
104
|
+
uses: shakenfist/actions/review-pr-with-claude@main
|
|
105
|
+
with:
|
|
106
|
+
pr-number: ${{ github.event.pull_request.number }}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: PR Re-review
|
|
2
|
+
|
|
3
|
+
# Triggers a re-review of a PR when an authorized user comments
|
|
4
|
+
# "@shakenfist-bot please re-review"
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
issues: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
issue_comment:
|
|
13
|
+
types: [created]
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
check_and_review:
|
|
17
|
+
# Only run on PR comments (not issue comments)
|
|
18
|
+
if: |
|
|
19
|
+
github.event.issue.pull_request &&
|
|
20
|
+
contains(github.event.comment.body, '@shakenfist-bot please re-review')
|
|
21
|
+
runs-on: [self-hosted, claude-code]
|
|
22
|
+
name: "Re-review PR"
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Check commenter permissions
|
|
26
|
+
id: check_permission
|
|
27
|
+
env:
|
|
28
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
+
run: |
|
|
30
|
+
permission=$(gh api \
|
|
31
|
+
repos/${{ github.repository }}/collaborators/${{ github.event.comment.user.login }}/permission \
|
|
32
|
+
--jq '.permission' 2>/dev/null || echo "none")
|
|
33
|
+
|
|
34
|
+
echo "User ${{ github.event.comment.user.login }} has permission: ${permission}"
|
|
35
|
+
|
|
36
|
+
if [[ "${permission}" == "admin" || "${permission}" == "write" ]]; then
|
|
37
|
+
echo "authorized=true" >> $GITHUB_OUTPUT
|
|
38
|
+
echo "User is authorized to request re-review"
|
|
39
|
+
else
|
|
40
|
+
echo "authorized=false" >> $GITHUB_OUTPUT
|
|
41
|
+
echo "User is not authorized to request re-review"
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
- name: React to comment
|
|
45
|
+
if: steps.check_permission.outputs.authorized == 'true'
|
|
46
|
+
env:
|
|
47
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
48
|
+
run: |
|
|
49
|
+
gh api \
|
|
50
|
+
repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
|
|
51
|
+
-f content='+1' \
|
|
52
|
+
--silent || true
|
|
53
|
+
|
|
54
|
+
- name: Post unauthorized message
|
|
55
|
+
if: steps.check_permission.outputs.authorized == 'false'
|
|
56
|
+
env:
|
|
57
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
58
|
+
run: |
|
|
59
|
+
gh pr comment ${{ github.event.issue.number }} \
|
|
60
|
+
--body "Sorry @${{ github.event.comment.user.login }}, only repository collaborators with write access can request a re-review."
|
|
61
|
+
|
|
62
|
+
- name: Checkout code
|
|
63
|
+
if: steps.check_permission.outputs.authorized == 'true'
|
|
64
|
+
uses: actions/checkout@v4
|
|
65
|
+
with:
|
|
66
|
+
fetch-depth: 0
|
|
67
|
+
|
|
68
|
+
- name: Run automated reviewer
|
|
69
|
+
if: steps.check_permission.outputs.authorized == 'true'
|
|
70
|
+
uses: shakenfist/actions/review-pr-with-claude@main
|
|
71
|
+
with:
|
|
72
|
+
pr-number: ${{ github.event.issue.number }}
|
|
73
|
+
force: 'true'
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Sanity checks
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- master
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
lint:
|
|
16
|
+
runs-on: [self-hosted, vm, debian-12]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code with two commits
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 2
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
sudo apt-get update
|
|
27
|
+
sudo apt-get dist-upgrade -y
|
|
28
|
+
sudo apt-get install -y -q tox python3 python3-venv python3-wheel
|
|
29
|
+
|
|
30
|
+
- name: Lint with flake8
|
|
31
|
+
run: |
|
|
32
|
+
tox -eflake8
|
|
33
|
+
|
|
34
|
+
- name: Run unit tests
|
|
35
|
+
run: |
|
|
36
|
+
tox -epy3
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Release workflow for Occy Strap
|
|
2
|
+
#
|
|
3
|
+
# Triggers on version tags (v*). Requires approval from the 'release'
|
|
4
|
+
# environment before publishing. Uses Sigstore for signing and PyPI
|
|
5
|
+
# trusted publishers for authentication.
|
|
6
|
+
#
|
|
7
|
+
# See RELEASE-SETUP.md for one-time configuration steps.
|
|
8
|
+
|
|
9
|
+
name: Release
|
|
10
|
+
|
|
11
|
+
permissions: {}
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
tags:
|
|
16
|
+
- 'v*'
|
|
17
|
+
|
|
18
|
+
# Allow manual trigger for testing (won't publish without a tag)
|
|
19
|
+
workflow_dispatch:
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build:
|
|
23
|
+
name: Build distribution packages
|
|
24
|
+
runs-on: [self-hosted, static]
|
|
25
|
+
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout repository
|
|
31
|
+
uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0 # Full history needed for pbr versioning
|
|
34
|
+
|
|
35
|
+
- name: Install build dependencies
|
|
36
|
+
run: |
|
|
37
|
+
rm -rf release-venv
|
|
38
|
+
python3 -m venv release-venv
|
|
39
|
+
release-venv/bin/pip3 install --upgrade pip
|
|
40
|
+
release-venv/bin/pip3 install build twine
|
|
41
|
+
|
|
42
|
+
- name: Build package
|
|
43
|
+
run: |
|
|
44
|
+
release-venv/bin/python3 -m build
|
|
45
|
+
|
|
46
|
+
- name: Check package with twine
|
|
47
|
+
run: |
|
|
48
|
+
release-venv/bin/twine check dist/*
|
|
49
|
+
|
|
50
|
+
- name: Upload distribution artifacts
|
|
51
|
+
uses: actions/upload-artifact@v4
|
|
52
|
+
with:
|
|
53
|
+
name: dist
|
|
54
|
+
path: dist/
|
|
55
|
+
|
|
56
|
+
sign-tag:
|
|
57
|
+
name: Sign release tag with Sigstore
|
|
58
|
+
needs: build
|
|
59
|
+
runs-on: [self-hosted, debian-12, s]
|
|
60
|
+
environment: release
|
|
61
|
+
|
|
62
|
+
permissions:
|
|
63
|
+
contents: write
|
|
64
|
+
id-token: write
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- name: Checkout repository
|
|
68
|
+
uses: actions/checkout@v4
|
|
69
|
+
with:
|
|
70
|
+
fetch-depth: 0
|
|
71
|
+
|
|
72
|
+
- name: Install gitsign
|
|
73
|
+
run: |
|
|
74
|
+
GITSIGN_VERSION="0.14.0"
|
|
75
|
+
curl -sLO "https://github.com/sigstore/gitsign/releases/download/v${GITSIGN_VERSION}/gitsign_${GITSIGN_VERSION}_linux_amd64"
|
|
76
|
+
curl -sLO "https://github.com/sigstore/gitsign/releases/download/v${GITSIGN_VERSION}/checksums.txt"
|
|
77
|
+
sha256sum --ignore-missing -c checksums.txt
|
|
78
|
+
chmod +x "gitsign_${GITSIGN_VERSION}_linux_amd64"
|
|
79
|
+
sudo mv "gitsign_${GITSIGN_VERSION}_linux_amd64" /usr/local/bin/gitsign
|
|
80
|
+
|
|
81
|
+
- name: Configure git for Sigstore signing
|
|
82
|
+
run: |
|
|
83
|
+
git config --global user.name "github-actions[bot]"
|
|
84
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
85
|
+
git config --global tag.gpgsign true
|
|
86
|
+
git config --global gpg.format x509
|
|
87
|
+
git config --global gpg.x509.program gitsign
|
|
88
|
+
|
|
89
|
+
- name: Create signed tag
|
|
90
|
+
env:
|
|
91
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
92
|
+
run: |
|
|
93
|
+
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
|
94
|
+
echo "Signing tag: ${TAG_NAME}"
|
|
95
|
+
git tag -d "${TAG_NAME}" || true
|
|
96
|
+
git tag -s "${TAG_NAME}" -m "Release ${TAG_NAME}" "${GITHUB_SHA}"
|
|
97
|
+
git push origin "${TAG_NAME}" --force
|
|
98
|
+
|
|
99
|
+
publish-pypi:
|
|
100
|
+
name: Publish to PyPI
|
|
101
|
+
needs: [build, sign-tag]
|
|
102
|
+
runs-on: [self-hosted, static]
|
|
103
|
+
environment: release
|
|
104
|
+
|
|
105
|
+
permissions:
|
|
106
|
+
id-token: write
|
|
107
|
+
attestations: write
|
|
108
|
+
|
|
109
|
+
steps:
|
|
110
|
+
- name: Download distribution artifacts
|
|
111
|
+
uses: actions/download-artifact@v4
|
|
112
|
+
with:
|
|
113
|
+
name: dist
|
|
114
|
+
path: dist/
|
|
115
|
+
|
|
116
|
+
- name: Generate attestations for artifacts
|
|
117
|
+
uses: actions/attest-build-provenance@v2
|
|
118
|
+
with:
|
|
119
|
+
subject-path: 'dist/*'
|
|
120
|
+
|
|
121
|
+
- name: Publish to PyPI
|
|
122
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
123
|
+
|
|
124
|
+
github-release:
|
|
125
|
+
name: Create GitHub Release
|
|
126
|
+
needs: [build, sign-tag, publish-pypi]
|
|
127
|
+
runs-on: [self-hosted, static]
|
|
128
|
+
|
|
129
|
+
permissions:
|
|
130
|
+
contents: write
|
|
131
|
+
|
|
132
|
+
steps:
|
|
133
|
+
- name: Download artifacts
|
|
134
|
+
uses: actions/download-artifact@v4
|
|
135
|
+
|
|
136
|
+
- name: Create GitHub Release
|
|
137
|
+
uses: softprops/action-gh-release@v2
|
|
138
|
+
with:
|
|
139
|
+
generate_release_notes: true
|
|
140
|
+
files: dist/*
|
|
141
|
+
env:
|
|
142
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Renovate dependency updater
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: '0 * * * *'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
renovate:
|
|
13
|
+
runs-on: [self-hosted, static]
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Self-hosted Renovate
|
|
19
|
+
uses: renovatebot/github-action@v41.0.22
|
|
20
|
+
with:
|
|
21
|
+
token: ${{ secrets.RENOVATE_TOKEN }}
|
|
22
|
+
env:
|
|
23
|
+
RENOVATE_AUTODISCOVER: "true"
|
|
24
|
+
RENOVATE_AUTODISCOVER_FILTER: "shakenfist/occystrap"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
*.egg
|
|
25
|
+
|
|
26
|
+
# Virtual environments
|
|
27
|
+
venv/
|
|
28
|
+
_venv/
|
|
29
|
+
ENV/
|
|
30
|
+
env/
|
|
31
|
+
|
|
32
|
+
# IDE
|
|
33
|
+
.idea/
|
|
34
|
+
.vscode/
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
|
|
38
|
+
# Testing
|
|
39
|
+
.tox/
|
|
40
|
+
.stestr/
|
|
41
|
+
.coverage
|
|
42
|
+
htmlcov/
|
|
43
|
+
|
|
44
|
+
# Temporary files
|
|
45
|
+
*.tmp
|
|
46
|
+
*.bak
|
|
47
|
+
|
|
48
|
+
# setuptools_scm generated version file
|
|
49
|
+
occystrap/_version.py
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/rhysd/actionlint
|
|
3
|
+
rev: v1.7.7
|
|
4
|
+
hooks:
|
|
5
|
+
- id: actionlint
|
|
6
|
+
args: ['-config-file', '.github/actionlint.yaml']
|
|
7
|
+
|
|
8
|
+
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
9
|
+
rev: v0.10.0.1
|
|
10
|
+
hooks:
|
|
11
|
+
- id: shellcheck
|
|
12
|
+
files: ^(tools/|release\.sh)
|
|
13
|
+
types_or: [sh, bash, shell]
|
|
14
|
+
args: ['-x']
|
|
15
|
+
|
|
16
|
+
- repo: local
|
|
17
|
+
hooks:
|
|
18
|
+
- id: tox-flake8
|
|
19
|
+
name: tox flake8
|
|
20
|
+
entry: tox -eflake8
|
|
21
|
+
language: system
|
|
22
|
+
pass_filenames: false
|
|
23
|
+
always_run: true
|
|
24
|
+
|
|
25
|
+
- id: tox-py3
|
|
26
|
+
name: tox py3
|
|
27
|
+
entry: tox -epy3
|
|
28
|
+
language: system
|
|
29
|
+
pass_filenames: false
|
|
30
|
+
always_run: true
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Shellcheck configuration for occystrap
|
|
2
|
+
#
|
|
3
|
+
# We disable some common warnings that are too noisy for our scripts.
|
|
4
|
+
# These are mostly style/info level issues that don't represent real bugs.
|
|
5
|
+
|
|
6
|
+
# SC2086: Double quote to prevent globbing and word splitting
|
|
7
|
+
# Our scripts run in controlled environments with known inputs.
|
|
8
|
+
disable=SC2086
|
|
9
|
+
|
|
10
|
+
# SC2196: egrep is deprecated, use grep -E
|
|
11
|
+
# While true, this is just a deprecation notice.
|
|
12
|
+
disable=SC2196
|
|
13
|
+
|
|
14
|
+
# SC2034: Variable appears unused
|
|
15
|
+
# Often sourced scripts export variables for use elsewhere.
|
|
16
|
+
disable=SC2034
|
|
17
|
+
|
|
18
|
+
# SC2046: Quote this to prevent word splitting
|
|
19
|
+
# Similar to SC2086, covered by controlled inputs.
|
|
20
|
+
disable=SC2046
|
|
21
|
+
|
|
22
|
+
# SC2001: See if you can use ${variable//search/replace}
|
|
23
|
+
# Style preference, not a bug.
|
|
24
|
+
disable=SC2001
|
|
25
|
+
|
|
26
|
+
# SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined
|
|
27
|
+
# Works fine in bash, which all our scripts use.
|
|
28
|
+
disable=SC2166
|
|
29
|
+
|
|
30
|
+
# SC2013: To read lines rather than words, pipe to 'while read'
|
|
31
|
+
# Our patch filenames don't contain spaces.
|
|
32
|
+
disable=SC2013
|
|
33
|
+
|
|
34
|
+
# SC2181: Check exit code directly, not indirectly with $?
|
|
35
|
+
# Style preference.
|
|
36
|
+
disable=SC2181
|
|
37
|
+
|
|
38
|
+
# SC2115: Use "${var:?}" to ensure this never expands to /
|
|
39
|
+
# Our scripts are always run in controlled environments.
|
|
40
|
+
disable=SC2115
|
|
41
|
+
|
|
42
|
+
# SC2004: $/${} is unnecessary on arithmetic variables
|
|
43
|
+
# We prefer explicit ${} for consistency.
|
|
44
|
+
disable=SC2004
|
|
45
|
+
|
|
46
|
+
# SC2206: Quote to prevent word splitting/globbing, or split robustly
|
|
47
|
+
# Our scripts run in controlled environments.
|
|
48
|
+
disable=SC2206
|
|
49
|
+
|
|
50
|
+
# SC2145: Argument mixes string and array
|
|
51
|
+
# Works as intended in our use cases.
|
|
52
|
+
disable=SC2145
|
|
53
|
+
|
|
54
|
+
# SC2236: Use -n instead of ! -z
|
|
55
|
+
# Style preference, both work.
|
|
56
|
+
disable=SC2236
|
|
57
|
+
|
|
58
|
+
# SC2116: Useless echo
|
|
59
|
+
# Sometimes used for clarity.
|
|
60
|
+
disable=SC2116
|
|
61
|
+
|
|
62
|
+
# SC2164: Use 'cd ... || exit' in case cd fails
|
|
63
|
+
# Our scripts use set -e which handles this.
|
|
64
|
+
disable=SC2164
|
|
65
|
+
|
|
66
|
+
# SC2048: Use "$@" (with quotes) to prevent whitespace problems
|
|
67
|
+
# Our scripts run in controlled environments.
|
|
68
|
+
disable=SC2048
|
|
69
|
+
|
|
70
|
+
# SC1091: Not following sourced file (file not found)
|
|
71
|
+
# Files exist at runtime on target systems.
|
|
72
|
+
disable=SC1091
|
|
73
|
+
|
|
74
|
+
# SC2231: Quote expansions in for loop glob
|
|
75
|
+
# Works as intended in our use cases.
|
|
76
|
+
disable=SC2231
|
|
77
|
+
|
|
78
|
+
# SC1090: Can't follow non-constant source
|
|
79
|
+
# Dynamic sources are intentional.
|
|
80
|
+
disable=SC1090
|
|
81
|
+
|
|
82
|
+
# SC2027: The surrounding quotes actually unquote this
|
|
83
|
+
# Intentional string formatting.
|
|
84
|
+
disable=SC2027
|
|
85
|
+
|
|
86
|
+
# SC2068: Double quote array expansions
|
|
87
|
+
# Our scripts run in controlled environments.
|
|
88
|
+
disable=SC2068
|
|
89
|
+
|
|
90
|
+
# SC2155: Declare and assign separately to avoid masking return values
|
|
91
|
+
# We check return values where needed.
|
|
92
|
+
disable=SC2155
|
|
93
|
+
|
|
94
|
+
# SC2221/SC2222: Pattern overrides another pattern
|
|
95
|
+
# Intentional catch-all in case statements.
|
|
96
|
+
disable=SC2221
|
|
97
|
+
disable=SC2222
|
|
98
|
+
|
|
99
|
+
# SC2153: Possible misspelling
|
|
100
|
+
# We know our variable names.
|
|
101
|
+
disable=SC2153
|
|
102
|
+
|
|
103
|
+
# SC2320: This $? refers to echo/printf, not a previous command
|
|
104
|
+
# We understand the ordering.
|
|
105
|
+
disable=SC2320
|
|
106
|
+
|
|
107
|
+
# SC2317: Command appears to be unreachable
|
|
108
|
+
# Traps and callbacks are invoked indirectly.
|
|
109
|
+
disable=SC2317
|
|
110
|
+
|
|
111
|
+
# SC2035: Use ./*glob* so names with dashes won't become options
|
|
112
|
+
# Our globs don't match filenames starting with -.
|
|
113
|
+
disable=SC2035
|
|
114
|
+
|
|
115
|
+
# SC2002: Useless cat
|
|
116
|
+
# Style preference, cat | cmd is more readable.
|
|
117
|
+
disable=SC2002
|
|
118
|
+
|
|
119
|
+
# SC2129: Consider using { cmd1; cmd2; } >> file
|
|
120
|
+
# Style preference.
|
|
121
|
+
disable=SC2129
|
|
122
|
+
|
|
123
|
+
# SC2031: Variable modified in subshell
|
|
124
|
+
# We understand subshell scoping.
|
|
125
|
+
disable=SC2031
|
|
126
|
+
|
|
127
|
+
# SC2124: Assigning an array to a string
|
|
128
|
+
# Intentional in some cases.
|
|
129
|
+
disable=SC2124
|
|
130
|
+
|
|
131
|
+
# SC2154: Variable is referenced but not assigned
|
|
132
|
+
# Variables are commonly sourced from other files or set before function calls.
|
|
133
|
+
disable=SC2154
|