Skip to content

Commit

Permalink
build: add helm chart for issuer component
Browse files Browse the repository at this point in the history
Refs: #2
  • Loading branch information
Phil91 committed Mar 14, 2024
1 parent d6b25bd commit ab909cc
Show file tree
Hide file tree
Showing 59 changed files with 3,055 additions and 67 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,37 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile-migrations
file: docker/Dockerfile-credential-issuer-migrations
push: true
tags: kind-registry:5000/migrations:testing
tags: kind-registry:5000/credential-issuer-migrations:testing

- name: Build service image
id: build-service-image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile-service
file: docker/Dockerfile-credential-issuer-service
push: true
tags: kind-registry:5000/service:testing
tags: kind-registry:5000/credential-issuer-service:testing

- name: Build expiry app
id: build-expiry-app-image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile-credential-expiry-app
push: true
tags: kind-registry:5000/credential-expiry-app:testing

- name: Build processes worker
id: build-processes-worker-image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile-credential-issuer-processes-worker
push: true
tags: kind-registry:5000/credential-issuer-processes-worker:testing

- name: Set up Helm
uses: azure/setup-helm@v3
with:
Expand All @@ -103,7 +121,7 @@ jobs:
run: ct lint --validate-maintainers=false --check-version-increment=false --target-branch ${{ github.event.repository.default_branch }}

- name: Run service chart-testing (install)
run: ct install --charts charts/ssi-credential-issuer --config charts/chart-testing-config.yaml --helm-extra-set-args "--set=issuer.image=kind-registry:5000/service:testing --set=issuermigrations.image=kind-registry:5000/migrations:testing"
run: ct install --charts charts/ssi-credential-issuer --config charts/chart-testing-config.yaml --helm-extra-set-args "--set=issuer.image=kind-registry:5000/credential-issuer-service:testing --set=issuermigrations.image=kind-registry:5000/credential-issuer-migrations:testing --set=processesworker.image=kind-registry:5000/credential-issuer-processes-worker --set=credentialexpiry.image=kind-registry:5000/credential-expiry-app"
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'

# TODO: re-add the step after the first version release
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/credential-expiry-app-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
###############################################################
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
###############################################################

name: Credential Expiry App

on:
push:
paths:
# service and transitive paths
- 'src/**'
# workflow file
- '.github/workflows/credential-expiry-app-docker.yml'
# dockerfile
- 'docker/Dockerfile-credential-expiry-app'

branches:
- 'dev'
workflow_dispatch:

env:
IMAGE_NAMESPACE: "tractusx"
IMAGE_NAME: "credential-expiry-app"

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=dev
type=raw,value=${{ github.sha }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile-credential-expiry-app
platforms: linux/amd64, linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# https://github.com/peter-evans/dockerhub-description
- name: Update Docker Hub description
if: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
readme-filepath: "./docker/notice-credential-expiry-app.md"
2 changes: 1 addition & 1 deletion .github/workflows/migrations-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
# workflow file
- '.github/workflows/migrations-docker.yml'
# dockerfile
- 'docker/Dockerfile-migrations'
- 'docker/Dockerfile-credential-issuer-migrations'

branches:
- 'dev'
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/owasp-zap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,37 @@ jobs:
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: docker/Dockerfile-migrations
file: docker/Dockerfile-credential-issuer-migrations
push: true
tags: kind-registry:5000/migrations:testing
tags: kind-registry:5000/credential-issuer-migrations:testing

- name: Build service image
id: build-service-image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: docker/Dockerfile-service
file: docker/Dockerfile-credential-issuer-service
push: true
tags: kind-registry:5000/service:testing
tags: kind-registry:5000/credential-issuer-service:testing

- name: Build Worker image
id: build-worker-image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: docker/Dockerfile-credential-issuer-processes-worker
push: true
tags: kind-registry:5000/credential-issuer-processes-worker:testing

- name: Build Expiry image
id: build-expiry-image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: docker/Dockerfile-credential-expiry-app
push: true
tags: kind-registry:5000/credential-expiry-app:testing

- name: Add bitnami repo
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
Expand All @@ -89,7 +107,7 @@ jobs:
helm dependency build
- name: Install the chart on KinD cluster
run: helm install testing -n apps --create-namespace --wait --set issuer.image=kind-registry:5000/service:testing --set=issuermigrations.image=kind-registry:5000/migrations:testing --set=issuer.swaggerEnabled=true charts/ssi-credential-issuer
run: helm install testing -n apps --create-namespace --wait --set issuer.image=kind-registry:5000/credential-issuer-service:testing --set=issuermigrations.image=kind-registry:5000/credential-issuer-migrations:testing --set=processesworker.image=kind-registry:5000/credential-issuer-processes-worker:testing --set=credentialexpiry.image=kind-registry:5000/credential-expiry-app:testing --set=issuer.swaggerEnabled=true charts/ssi-credential-issuer

- name: Configure port forward to app in KinD
run: |
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/processes-worker-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
###############################################################
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
###############################################################

name: Processes Worker

on:
push:
paths:
# service and transitive paths
- 'src/**'
# workflow file
- '.github/workflows/process-worker-docker.yml'
# dockerfile
- 'docker/Dockerfile-credential-issuer-process-worker'

branches:
- 'dev'
workflow_dispatch:

env:
IMAGE_NAMESPACE: "tractusx"
IMAGE_NAME: "credential-issuer-process-worker"

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=dev
type=raw,value=${{ github.sha }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile-credential-issuer-process-worker
platforms: linux/amd64, linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# https://github.com/peter-evans/dockerhub-description
- name: Update Docker Hub description
if: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
readme-filepath: "./docker/notice-credential-issuer-process-worker.md"
71 changes: 67 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ env:
IMAGE_NAMESPACE: "tractusx"
IMAGE_NAME_SERVICE: "service"
IMAGE_NAME_MIGRATIONS: "migrations"
IMAGE_NAME_WORKER: "credential-issuer-processes-worker"
IMAGE_NAME_EXPIRY: "credential-expiry-app"

jobs:
service-release:
Expand Down Expand Up @@ -74,7 +76,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile-service
file: docker/Dockerfile-credential-issuer-service
platforms: linux/amd64, linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
Expand All @@ -89,7 +91,7 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME_SERVICE }}
readme-filepath: "./docker/notice-service.md"
readme-filepath: "./docker/notice-credential-issuer-service.md"

migrations-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -134,7 +136,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile-migrations
file: docker/Dockerfile-credential-issuer-migrations
platforms: linux/amd64, linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
Expand All @@ -149,4 +151,65 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME_MIGRATIONS }}
readme-filepath: "./docker/notice-migrations.md"
readme-filepath: "./docker/notice-credential-issuer-migrations.md"

expiry-release:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME_EXPIRY }}
# Automatically prepare image tags; See action docs for more examples.
# semver patter will generate tags like these for example :1 :1.2 :1.2.3
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile-credential-expiry-app
platforms: linux/amd64, linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# https://github.com/peter-evans/dockerhub-description
- name: Update Docker Hub description
if: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME_EXPIRY }}
readme-filepath: "./docker/notice-credential-expiry-app.md"

Loading

0 comments on commit ab909cc

Please sign in to comment.