Fix container image workflows

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-06-15 11:15:33 +02:00 committed by Daniel Weiße
parent 86d29a4567
commit 84ca9e3070
5 changed files with 23 additions and 8 deletions

View File

@ -4,6 +4,10 @@ inputs:
name: name:
description: 'Name of the micro-service' description: 'Name of the micro-service'
required: true required: true
projectVersion:
description: 'Version of the micro-service'
default: '0.0.0'
required: false
dockerfile: dockerfile:
description: 'Path to the services Dockerfile' description: 'Path to the services Dockerfile'
required: true required: true
@ -13,6 +17,7 @@ inputs:
githubToken: githubToken:
description: 'GitHub authorization token' description: 'GitHub authorization token'
required: true required: true
runs: runs:
using: "composite" using: "composite"
@ -49,3 +54,5 @@ runs:
target: release target: release
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
build-args: |
PROJECT_VERSION=${{ inputs.projectVersion }}

View File

@ -28,5 +28,6 @@ jobs:
uses: ./.github/actions/build_micro-service uses: ./.github/actions/build_micro-service
with: with:
name: access-manager name: access-manager
projectVersion: '0.0.0'
dockerfile: access_manager/Dockerfile dockerfile: access_manager/Dockerfile
github_token: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -30,5 +30,6 @@ jobs:
uses: ./.github/actions/build_micro-service uses: ./.github/actions/build_micro-service
with: with:
name: activation-service name: activation-service
projectVersion: '0.0.0'
dockerfile: activation/Dockerfile dockerfile: activation/Dockerfile
github_token: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -29,5 +29,6 @@ jobs:
uses: ./.github/actions/build_micro-service uses: ./.github/actions/build_micro-service
with: with:
name: kmsserver name: kmsserver
projectVersion: '0.0.0'
dockerfile: Dockerfile.kms dockerfile: Dockerfile.kms
github_token: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -11,11 +11,15 @@ on:
- 'activation-service' - 'activation-service'
- 'kmsserver' - 'kmsserver'
required: true required: true
default: 'access manager' default: 'access-manager'
imageTag: imageTag:
description: 'Container image tag' description: 'Container image tag'
required: true required: true
default: 'manual-build' default: 'manual-build'
version:
description: 'Version of the image to build'
required: true
default: '0.0.0'
jobs: jobs:
build-micro-service: build-micro-service:
@ -32,11 +36,11 @@ jobs:
- name: Set Dockerfile variable - name: Set Dockerfile variable
id: set-variable id: set-variable
run: | run: |
case "${{ env.someVar }}" in case "${{ inputs.microService }}" in
"access-manager" ) "access-manager" )
echo "microServiceDockerfile=access_manager/Dockerfile" >> $GITHUB_ENV ;; echo "microServiceDockerfile=access_manager/Dockerfile" >> $GITHUB_ENV ;;
"activation-service" ) "activation-service" )
echo "microServiceDockerfile=activation-service/Dockerfile" >> $GITHUB_ENV ;; echo "microServiceDockerfile=activation/Dockerfile" >> $GITHUB_ENV ;;
"kmsserver" ) "kmsserver" )
echo "microServiceDockerfile=Dockerfile.kms" >> $GITHUB_ENV ;; echo "microServiceDockerfile=Dockerfile.kms" >> $GITHUB_ENV ;;
esac esac
@ -46,6 +50,7 @@ jobs:
uses: ./.github/actions/build_micro-service uses: ./.github/actions/build_micro-service
with: with:
name: ${{ inputs.microService }} name: ${{ inputs.microService }}
projectVersion: '0.0.0'
dockerfile: ${{ env.microServiceDockerfile }} dockerfile: ${{ env.microServiceDockerfile }}
tag: ${{ inputs.imageTag }} pushTag: ${{ inputs.imageTag }}
github_token: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}