Skip to content

feat: migrate MUG to DAMAP base version 4.6.1 #47

feat: migrate MUG to DAMAP base version 4.6.1

feat: migrate MUG to DAMAP base version 4.6.1 #47

Workflow file for this run

name: DAMAP Backend Instances
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
required: false
default: 'main'
instance:
type: choice
description: 'Choose the backend instance'
options:
- TUG
- MUG
- JKU
- all
required: false
default: 'all'
base_version:
description: 'DAMAP base version to use'
required: false
default: ''
release_tag:
description: 'Release tag for all images'
required: false
default: ''
jobs:
build-backend-mug:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.instance == 'all' || github.event.inputs.instance == 'MUG' }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Convert repository name to lowercase
run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Determine Docker tag (from tag or branch)
id: get_tag
run: |
if [[ "${{ github.event.inputs.release_tag }}" != "" ]]; then
TAG_NAME="${{ github.event.inputs.release_tag }}"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
else
TAG_NAME="${GITHUB_REF#refs/heads/}"
fi
echo "DOCKER_TAG=$TAG_NAME" >> $GITHUB_ENV
- name: Set up build arguments
run: |
BUILD_ARGS="INSTANCE_NAME=MUG"
if [[ "${{ github.event.inputs.base_version }}" != "" ]]; then
BUILD_ARGS="$BUILD_ARGS\nDAMAP_BASE_VERSION=${{ github.event.inputs.base_version }}"
fi
echo "BUILD_ARGS<<EOF" >> $GITHUB_ENV
echo -e "$BUILD_ARGS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push MUG Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
no-cache: true
build-args: ${{ env.BUILD_ARGS }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }}-mug
labels: ${{ steps.meta.outputs.labels }}
build-backend-tug:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.instance == 'all' || github.event.inputs.instance == 'TUG' }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Convert repository name to lowercase
run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Determine Docker tag (from tag or branch)
id: get_tag
run: |
if [[ "${{ github.event.inputs.release_tag }}" != "" ]]; then
TAG_NAME="${{ github.event.inputs.release_tag }}"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
else
TAG_NAME="${GITHUB_REF#refs/heads/}"
fi
echo "DOCKER_TAG=$TAG_NAME" >> $GITHUB_ENV
- name: Set up build arguments
run: |
BUILD_ARGS="INSTANCE_NAME=TUG"
if [[ "${{ github.event.inputs.base_version }}" != "" ]]; then
BUILD_ARGS="$BUILD_ARGS\nDAMAP_BASE_VERSION=${{ github.event.inputs.base_version }}"
fi
echo "BUILD_ARGS<<EOF" >> $GITHUB_ENV
echo -e "$BUILD_ARGS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push TUG Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
no-cache: true
build-args: ${{ env.BUILD_ARGS }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }}-tug
labels: ${{ steps.meta.outputs.labels }}
build-backend-jku:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.instance == 'all' || github.event.inputs.instance == 'JKU' }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Convert repository name to lowercase
run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Determine Docker tag (from tag or branch)
id: get_tag
run: |
if [[ "${{ github.event.inputs.release_tag }}" != "" ]]; then
TAG_NAME="${{ github.event.inputs.release_tag }}"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
else
TAG_NAME="${GITHUB_REF#refs/heads/}"
fi
echo "DOCKER_TAG=$TAG_NAME" >> $GITHUB_ENV
- name: Set up build arguments
run: |
BUILD_ARGS="INSTANCE_NAME=JKU"
if [[ "${{ github.event.inputs.base_version }}" != "" ]]; then
BUILD_ARGS="$BUILD_ARGS\nDAMAP_BASE_VERSION=${{ github.event.inputs.base_version }}"
fi
echo "BUILD_ARGS<<EOF" >> $GITHUB_ENV
echo -e "$BUILD_ARGS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push JKU Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
no-cache: true
build-args: ${{ env.BUILD_ARGS }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }}-jku
labels: ${{ steps.meta.outputs.labels }}