Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
version: 2

updates:
# Python dependencies
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "setuptools"
versions: ["*"]
reviewers:
- "GabrielPalmar"

# Docker dependencies
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "GabrielPalmar"

# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "GabrielPalmar"
version: 2
updates:
# Python dependencies
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "setuptools"
versions: ["*"]
reviewers:
- "GabrielPalmar"
# Docker dependencies
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "GabrielPalmar"
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "GabrielPalmar"
144 changes: 72 additions & 72 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
name: Build_Push

on:
push:
branches:
- main

permissions:
contents: read
packages: write

jobs:
docker_build_test:
runs-on: ubuntu-24.04
name: Docker_build and Helm_build
steps:
- uses: actions/checkout@v5

- name: Build the Docker image
run: |
docker build -t ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) .
docker tag ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) ghcr.io/gabrielpalmar/hivebox:latest

- name: Push Docker image to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/gabrielpalmar/hivebox:$(cat version.txt)
docker push ghcr.io/gabrielpalmar/hivebox:latest

# Get the SHA256 digest
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) | cut -d'@' -f2)
if [ -z "$DIGEST" ]; then
echo "Failed to capture Docker digest"
exit 1
fi
echo "Image digest: $DIGEST"
echo "DOCKER_DIGEST=$DIGEST" >> $GITHUB_ENV

- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
if ! command -v helm version &> /dev/null; then
echo "Helm could not be installed"
exit 1
fi

- name: Build Helm Chart
run: |
VERSION=$(cat version.txt)
sed -i "s/^version:.*/version: $VERSION/" ./helm-chart/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"$VERSION\"/" ./helm-chart/Chart.yaml
sed -i "s|hivebox: ghcr.io/gabrielpalmar/hivebox:.*|hivebox: ghcr.io/gabrielpalmar/hivebox:$VERSION@$DOCKER_DIGEST|" ./helm-chart/values.yaml
helm package ./helm-chart

- name: Push Helm Chart to GHCR
run: |
CHART_FILE="hivebox-$(cat version.txt).tgz"
if [ ! -f "$CHART_FILE" ]; then
echo "Helm chart $CHART_FILE not found"
exit 1
fi
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
helm push $CHART_FILE oci://ghcr.io/gabrielpalmar/hivebox-helm-charts

- name: Add job summary
run: |
VERSION=$(cat version.txt)
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- Docker image: ghcr.io/gabrielpalmar/hivebox:$VERSION" >> $GITHUB_STEP_SUMMARY
echo "- Image digest: $DOCKER_DIGEST" >> $GITHUB_STEP_SUMMARY
name: Build_Push
on:
push:
branches:
- main
permissions:
contents: read
packages: write
jobs:
docker_build_test:
runs-on: ubuntu-24.04
name: Docker_build and Helm_build
steps:
- uses: actions/checkout@v5
- name: Build the Docker image
run: |
docker build -t ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) .
docker tag ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) ghcr.io/gabrielpalmar/hivebox:latest
- name: Push Docker image to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/gabrielpalmar/hivebox:$(cat version.txt)
docker push ghcr.io/gabrielpalmar/hivebox:latest
# Get the SHA256 digest
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) | cut -d'@' -f2)
if [ -z "$DIGEST" ]; then
echo "Failed to capture Docker digest"
exit 1
fi
echo "Image digest: $DIGEST"
echo "DOCKER_DIGEST=$DIGEST" >> $GITHUB_ENV
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
if ! command -v helm version &> /dev/null; then
echo "Helm could not be installed"
exit 1
fi
- name: Build Helm Chart
run: |
VERSION=$(cat version.txt)
sed -i "s/^version:.*/version: $VERSION/" ./helm-chart/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"$VERSION\"/" ./helm-chart/Chart.yaml
sed -i "s|hivebox: ghcr.io/gabrielpalmar/hivebox:.*|hivebox: ghcr.io/gabrielpalmar/hivebox:$VERSION@$DOCKER_DIGEST|" ./helm-chart/values.yaml
helm package ./helm-chart
- name: Push Helm Chart to GHCR
run: |
CHART_FILE="hivebox-$(cat version.txt).tgz"
if [ ! -f "$CHART_FILE" ]; then
echo "Helm chart $CHART_FILE not found"
exit 1
fi
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
helm push $CHART_FILE oci://ghcr.io/gabrielpalmar/hivebox-helm-charts
- name: Add job summary
run: |
VERSION=$(cat version.txt)
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- Docker image: ghcr.io/gabrielpalmar/hivebox:$VERSION" >> $GITHUB_STEP_SUMMARY
echo "- Image digest: $DOCKER_DIGEST" >> $GITHUB_STEP_SUMMARY
echo "- Helm chart: hivebox-$VERSION" >> $GITHUB_STEP_SUMMARY
92 changes: 46 additions & 46 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
name: Build_Test

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
docker_build_test:
runs-on: ubuntu-24.04
name: Docker_build
steps:
- uses: actions/checkout@v5
- name: Build the Docker image
run: docker build -t gabrielpalmar/hivebox:$(cat version.txt) .

- name: Run Docker container
run: docker run -d -p 5000:5000 gabrielpalmar/hivebox:$(cat version.txt)

- name: Set up Python for testing
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install vcrpy

- name: Run tests
run: |
python tests/test_main.py
TEST_EXIT_CODE=$?
if [ $TEST_EXIT_CODE -ne 0 ]; then
echo "Tests failed!"
exit $TEST_EXIT_CODE
fi

- name: Stop Docker container
name: Build_Test
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
docker_build_test:
runs-on: ubuntu-24.04
name: Docker_build
steps:
- uses: actions/checkout@v5
- name: Build the Docker image
run: docker build -t gabrielpalmar/hivebox:$(cat version.txt) .
- name: Run Docker container
run: docker run -d -p 5000:5000 gabrielpalmar/hivebox:$(cat version.txt)
- name: Set up Python for testing
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install vcrpy
- name: Run tests
run: |
python tests/test_main.py
TEST_EXIT_CODE=$?
if [ $TEST_EXIT_CODE -ne 0 ]; then
echo "Tests failed!"
exit $TEST_EXIT_CODE
fi
- name: Stop Docker container
run: docker stop $(docker ps -q)
40 changes: 20 additions & 20 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Hadolint

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
hadolint-linting:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: hadolint/hadolint-action@v3.3.0
with:
name: Hadolint
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
hadolint-linting:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: Dockerfile
48 changes: 24 additions & 24 deletions .github/workflows/kube-linter.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Kube-Linter

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Scan repo with kube-linter
uses: stackrox/kube-linter-action@v1.0.4
with:
directory: helm-chart
name: Kube-Linter
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Scan repo with kube-linter
uses: stackrox/kube-linter-action@v1.0.4
with:
directory: helm-chart
Loading
Loading