-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: use poetry for building and update os to ubi9-minimal (#255)
Updates several subsystems: * Python 3.11 (upgrading from 3.9) * AlmaLinux 9 instead of CentOS 7 * Poetry instead of setuptools * ruff instead of pylint/mypy * helm chart for deployment
- Loading branch information
Showing
39 changed files
with
1,781 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vuln.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
target-branch: main | ||
charts: | ||
- charts/catpage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,54 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
call-workflow: | ||
uses: radiorabe/actions/.github/workflows/test-pre-commit.yaml@main | ||
test: | ||
pre-commit: | ||
uses: radiorabe/actions/.github/workflows/[email protected] | ||
python-poetry: | ||
uses: radiorabe/actions/.github/workflows/[email protected] | ||
helm-chart: | ||
name: Test Helm Chart | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.x', '3.9' ] | ||
name: Test python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
- name: Test | ||
run: | | ||
pytest --cov=app --cov-report=term --cov-fail-under=100 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build dev image | ||
run: | | ||
docker build -t ghcr.io/radiorabe/catpage:latest -f Dockerfile . | ||
docker save -o /tmp/catpage.tar ghcr.io/radiorabe/catpage:latest | ||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.11.0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct --config=.github/ct.yaml list-changed) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct --config=.github/ct.yaml lint | ||
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Load dev image | ||
run: | | ||
kind load image-archive /tmp/catpage.tar --name chart-testing | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Run chart-testing (install) | ||
run: ct --config=.github/ct.yaml install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish Container Images | ||
name: Release | ||
|
||
on: | ||
push: | ||
|
@@ -7,68 +7,52 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
docker: | ||
release-container: | ||
uses: radiorabe/actions/.github/workflows/[email protected] | ||
with: | ||
image: 'ghcr.io/radiorabe/catpage' | ||
name: 'catpage' | ||
display-name: 'Cat Page' | ||
tags: 'minimal rhel9 rabe s2i python python311 catpage' | ||
helm-chart: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: | ||
- release-container | ||
permissions: | ||
actions: none | ||
checks: none | ||
contents: none | ||
deployments: none | ||
issues: none | ||
packages: write | ||
pull-requests: none | ||
repository-projects: none | ||
security-events: none | ||
statuses: none | ||
id-token: none | ||
steps: | ||
- | ||
name: Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare additional Metadata | ||
id: addtional_meta | ||
run: | | ||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
- name: Prepare Chart Metadata | ||
id: chartmeta | ||
run: echo version=${GITHUB_REF#refs/tags/v} >> $GITHUB_OUTPUT | ||
|
||
- name: Prepare Image Metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
with: | ||
images: | | ||
ghcr.io/radiorabe/catpage | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
labels: | | ||
name=cat-page | ||
summary=${{ github.event.repository.description }} | ||
url=${{ github.event.repository.html_url }} | ||
vcs-ref=${{ github.sha }} | ||
revision=${{ github.sha }} | ||
release=${{ github.sha }} | ||
build-date=${{ steps.addtional_meta.outputs.created }} | ||
io.k8s.display-name=Cat Page | ||
io.k8s.description=${{ github.event.repository.description }} | ||
io.openshift.tags=minimal rhel8 rabe s2i python python39 catpage | ||
version=1 | ||
version: v3.12.0 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Package Chart | ||
run: helm package --version ${{ steps.chartmeta.outputs.version }} --app-version ${{ steps.chartmeta.outputs.version }} --destination=dist charts/catpage | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: | | ||
${{ steps.meta.outputs.labels }} | ||
version=${{ steps.meta.outputs.version }} | ||
- name: Push Chart | ||
run: helm push dist/*.tgz oci://ghcr.io/radiorabe/helm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,6 @@ on: | |
|
||
jobs: | ||
semantic-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run go-semantic-release | ||
id: semrel | ||
uses: go-semantic-release/action@v1 | ||
with: | ||
github-token: ${{ secrets.RABE_ITREAKTION_GITHUB_TOKEN }} | ||
uses: radiorabe/actions/.github/workflows/[email protected] | ||
secrets: | ||
RABE_ITREAKTION_GITHUB_TOKEN: ${{ secrets.RABE_ITREAKTION_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ __pycache__ | |
/cov/ | ||
/.coverage | ||
/node_modules/ | ||
venv/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.