Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Bump org.apache.maven.plugins:maven-compiler-plugin from 3.11.0 to 3.12.0 in /apis/java/quarkus #101

Bump org.apache.maven.plugins:maven-compiler-plugin from 3.11.0 to 3.12.0 in /apis/java/quarkus

Bump org.apache.maven.plugins:maven-compiler-plugin from 3.11.0 to 3.12.0 in /apis/java/quarkus #101

name: openshift-java-quarkus
env:
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_NAMESPACE_NO_ENV: ${{ secrets.NAMESPACE_NO_ENV}}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}/nr-arch-templates
IMAGE_REGISTRY_USER: ${{ github.actor }}
IMAGE_REGISTRY_PASSWORD: ${{ github.token }}
OIDC_AUTH_SERVER_URL: ${{ secrets.OIDC_AUTH_SERVER_URL }}
# 🖊️ EDIT to specify custom tags for the container image, or default tags will be generated below.
IMAGE_TAGS: ""
DOCKER_ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca/docker-remote
ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca
APP_NAME: 'quarkus'
REPO_NAME: "nr-arch-templates"
JOB_NAME: "main"
NAMESPACE: ${{ secrets.NAMESPACE_NO_ENV }}
TAG: "latest"
TARGET_ENV: "dev"
MIN_REPLICAS: "1"
MAX_REPLICAS: "1"
MIN_CPU: "50m"
MAX_CPU: "150m"
MIN_MEM: "100Mi"
MAX_MEM: "250Mi"
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'apis/java/quarkus/**'
jobs:
builds:
name: Build and deploy to OpenShift
runs-on: ubuntu-22.04
environment: quarkus-dev
defaults:
run:
working-directory: apis/java/quarkus
outputs:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
strategy:
matrix:
package: [quarkus, quarkus-migration]
include:
- package: quarkus
triggers: ('apis/java/quarkus')
build_file: ./apis/java/quarkus/.pipeline/openshift/Dockerfile.native-openshift
build_context: ./apis/java/quarkus
- package: quarkus-migration
triggers: ('apis/java/quarkus')
build_file: ./apis/java/quarkus/.pipeline/openshift/Dockerfile-migrations-openshift
build_context: ./apis/java/quarkus
steps:
- uses: actions/checkout@v3
- uses: bcgov-nr/action-builder-ghcr@v1.1.0
with:
package: ${{ matrix.package }}
build_file: ${{ matrix.build_file }}
build_context: ${{ matrix.build_context }}
tag: latest
tag_fallback: test
token: ${{ secrets.GITHUB_TOKEN }}
triggers: ${{ matrix.triggers }}
deploys:
name: Deploys
environment: quarkus-dev
needs:
- builds
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Deploy
run: |
set +e -ux
# Login to OpenShift and select project
oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }}
oc tag -d ${{ env.APP_NAME }}:${{ env.TAG }}
oc tag -d ${{ env.APP_NAME }}-migration:${{ env.TAG }}
oc tag ${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ env.TAG }}
oc tag ${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}-migration:latest ${{ env.APP_NAME }}-migration:${{ env.TAG }}
# Process and create postgres deployment template
oc process -f https://raw.githubusercontent.com/bcgov/nr-arch-templates/main/apis/TypeScript/Nest/.pipeline/openshift/openshift-postgres-deployment-config.yaml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p JOB_NAME=${{ env.JOB_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_NO_ENV }}-${{env.TARGET_ENV}} \
| oc create -f -
#check the status
oc rollout status dc/${{ env.APP_NAME }}-postgres
# Process and apply deployment template
oc process -f https://raw.githubusercontent.com/bcgov/nr-arch-templates/main/apis/java/quarkus/.pipeline/openshift/openshift-deployment-config.yml -p APP_NAME=${{ env.APP_NAME }} -p REPO_NAME=${{ env.REPO_NAME }} -p JOB_NAME=${{ env.JOB_NAME }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE_NO_ENV }}-${{env.TARGET_ENV}} -p TAG=${{ env.TAG }} -p MIN_REPLICAS=${{ env.MIN_REPLICAS }} -p MAX_REPLICAS=${{ env.MAX_REPLICAS }} -p MIN_CPU=${{ env.MIN_CPU }} -p MAX_CPU=${{ env.MAX_CPU }} -p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} \
| oc apply -f -
curl -s https://raw.githubusercontent.com/bcgov/${{ env.REPO_NAME }}/main/apis/java/quarkus/.pipeline/openshift/openshift-config-map.sh | bash /dev/stdin ${{ env.APP_NAME }} ${{ env.OIDC_AUTH_SERVER_URL }} ${{ env.OPENSHIFT_NAMESPACE_NO_ENV }}-${{env.TARGET_ENV}}
# Start rollout (if necessary) and follow it
oc rollout latest dc/${{ env.APP_NAME }} 2> /dev/null \
|| true && echo "Rollout in progress"
oc logs -f dc/${{ env.APP_NAME }}
# Get status, returns 0 if rollout is successful
oc rollout status dc/${{ env.APP_NAME }}