Skip to content

Commit

Permalink
feat: release docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed Sep 15, 2024
1 parent 53737b1 commit 593a51c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

!package.json
!package-lock.json

!target/release
11 changes: 11 additions & 0 deletions .github/pipeline/dockerBuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

set -ex

release_version=$1
image_name="ghcr.io/postfinance/propeller:$release_version"

echo "$GITHUB_TOKEN " | docker login ghcr.io -u "$GITHUB_USERNAME" --password-stdin

docker build --build-arg "RELEASE_VERSION=$release_version" -t "$image_name" .
docker push "$image_name"
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
permissions:
contents: write
issues: write
packages: write
pull-requests: write
steps:
- name: Check out code
Expand Down Expand Up @@ -49,4 +50,5 @@ jobs:
- name: Semantic Release
run: npx semantic-release
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM debian:bullseye-slim

ARG RELEASE_VERSION

LABEL org.opencontainers.image.title="propeller"
LABEL org.opencontainers.image.source="https://github.com/postfinance/propeller"
LABEL org.opencontainers.image.description="A secret rotation tool for applications running in Kubernetes, using HashiCorp Vault and ArgoCD."
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.version="$RELEASE_VERSION"
LABEL org.opencontainers.image.vendor="PostFinance AG"

RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*

COPY target/release/propeller /usr/local/bin/propeller

ENTRYPOINT ["propeller"]
1 change: 1 addition & 0 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'@semantic-release/exec',
{
prepareCmd: '.github/pipeline/prepareCmd.sh ${nextRelease.version}',
publishCmd: '.github/pipeline/dockerBuild.sh ${nextRelease.version}',
},
],
[
Expand Down

0 comments on commit 593a51c

Please sign in to comment.