Skip to content

Commit 9e97dd2

Browse files
committed
Single python release and review points
Signed-off-by: Luke Hinds <luke@stacklok.com>
1 parent 2b2beca commit 9e97dd2

File tree

8 files changed

+33
-169
lines changed

8 files changed

+33
-169
lines changed

.github/workflows/build-publish-image.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@ name: Build and Publish Bandit Images
33
on:
44
release:
55
types: [created]
6+
schedule:
7+
- cron: '0 0 * * 0' # Every Sunday at midnight
68

79
jobs:
810
build-and-publish:
911
runs-on: ubuntu-latest
1012
permissions:
1113
contents: read
1214
packages: write
13-
# This is used to complete the identity challenge
14-
# with sigstore/fulcio when running outside of PRs.
1515
id-token: write
16-
strategy:
17-
matrix:
18-
python-version: ['38', '39', '310', '311', '312']
19-
architecture: [amd64, arm64]
16+
2017
steps:
2118
- name: Check out the repo
2219
uses: actions/checkout@v4
@@ -41,14 +38,14 @@ jobs:
4138
uses: docker/build-push-action@v5
4239
with:
4340
context: .
44-
file: ./docker/Dockerfile-py${{ matrix.python-version }}
41+
file: ./docker/Dockerfile
4542
push: true
46-
tags: ghcr.io/${{ github.repository }}/bandit:py${{ matrix.python-version }}-${{ matrix.architecture }}
47-
platforms: linux/${{ matrix.architecture }}
43+
tags: ghcr.io/${{ github.repository }}/bandit:latest
44+
platforms: linux/amd64, linux/arm64
4845

4946
- name: Sign the image
5047
env:
51-
TAGS: ghcr.io/${{ github.repository }}/bandit:py${{ matrix.python-version }}-${{ matrix.architecture }}
48+
TAGS: ghcr.io/${{ github.repository }}/bandit:latest
5249
DIGEST: ${{ steps.build-and-push.outputs.digest }}
5350
run: |
54-
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
51+
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

README.rst

+9-13
Original file line numberDiff line numberDiff line change
@@ -91,34 +91,30 @@ Bandit is available as a container image, built within the bandit repository
9191
using GitHub Actions. The image is available on gchr.io:
9292

9393
```bash
94-
docker pull gcr.io/pycqa/bandit/bandit:py312-arm64
94+
docker pull ghcr.io/pycqa/bandit/bandit
9595
```
9696

9797
The image is built for the following architectures:
9898

9999
* amd64
100100
* arm64
101+
* armv7
101102

102-
The image is tagged with the Python version and architecture, for example:
103+
To pull a specific architecture, use the following format:
103104

104-
* py312-amd64
105-
* py312-arm64
106-
107-
Python versions supported are:
105+
```bash
106+
docker pull ghcr.io/pycqa/bandit/bandit:<tag>-<arch>
107+
```
108108

109-
* 3.8 (py38-amd64)
110-
* 3.9 (py39-amd64)
111-
* 3.10 (py310-amd64)
112-
* 3.11 (py311-amd64)
113-
* 3.12 (py312-amd64)
109+
Where `<tag>` is the release version of Bandit and `<arch>` is the architecture
114110

115111
Every image is signed with sigstore cosign and it is possible to verify the
116112
source of origin using the following cosign command:
117113

118114
```bash
119115
cosign verify ghcr.io/pycqa/bandit/bandit:py39-amd64 \
120-
--certificate-identity https://github.com/pycqa/bandit/.github/workflows/build-publish-image.yml@refs/tags/1.7.6 \
116+
--certificate-identity https://github.com/pycqa/bandit/.github/workflows/build-publish-image.yml@refs/tags/<version> \
121117
--certificate-oidc-issuer https://token.actions.githubusercontent.com
122118
```
123119

124-
Where `1.7.6` is the release version of Bandit.
120+
Where `<version>` is the release version of Bandit.

docker/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:3.12-alpine
2+
3+
# Install Git (required for pbr versioning)
4+
RUN apk add --no-cache git
5+
6+
# Copy the source code into the container
7+
COPY . /bandit
8+
9+
# Set the working directory
10+
WORKDIR /bandit
11+
12+
# Install Bandit from the source code using pip
13+
RUN pip install .
14+
15+
# Define entrypoint and default command
16+
ENTRYPOINT ["bandit"]

docker/Dockerfile-py310

-29
This file was deleted.

docker/Dockerfile-py311

-29
This file was deleted.

docker/Dockerfile-py312

-29
This file was deleted.

docker/Dockerfile-py38

-29
This file was deleted.

docker/Dockerfile-py39

-29
This file was deleted.

0 commit comments

Comments
 (0)