Skip to content

Main - Build Image and Push to Openshift Registry for Dev Deployment #28

Main - Build Image and Push to Openshift Registry for Dev Deployment

Main - Build Image and Push to Openshift Registry for Dev Deployment #28

Workflow file for this run

# Deploy an artifact onto Dev
name: Main - Build Image and Push to Openshift Registry for Dev Deployment
on:
workflow_dispatch:
inputs:
app_name:
required: true
description: App to be deployed
type: choice
options:
- dps-email-poller
- dps-email-worker
- dps-notification-service
- dps-payment-service
- dps-validation-service
- figaro-validation-service
- spd-notification-worker
- vips-notification-worker
environment:
required: true
description: What is the targeted environment?
type: choice
options:
- dev
- test
- prod
jobs:
unit-test:
uses: SierraSystems/reusable-workflows/.github/workflows/java-unit-tests.yml@main
with:
working_directory: "src"
profile: ${{ github.event.inputs.app_name }}
secrets:
nexus_url: ${{ secrets.NEXUS_URL }}
# app-version disabled since "Error: Process completed with exit code 1.", not sure exit code 1 is because of echo 1 (${version)
# app-version:
# uses: SierraSystems/reusable-workflows/.github/workflows/java-maven-app-version.yml@main
# with:
# working_directory: "src/${{ github.event.inputs.app_name }}"
build-and-push-image:
needs:
- unit-test
# - app-version
uses: SierraSystems/reusable-workflows/.github/workflows/docker-build-and-push-image.yml@main
with:
app_name: ${{ github.event.inputs.app_name }}
working_directory: .
# image_tags: "dev,${{ needs.app-version.outputs.app-version }}"
image_tags: "dev,1"
env: tools
build_args: |-
DPS_SERVICE_NAME=${{ github.event.inputs.app_name }}
MVN_PROFILES=${{ github.event.inputs.app_name }},openshift
secrets:
openshift_server_url: "${{ secrets.OPENSHIFT_SERVER_URL_SILVER }}"
openshift_token: "${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}"
openshift_external_repository: "${{ secrets.OPENSHIFT_EXTERNAL_REPOSITORY_SILVER }}"
openshift_license_plate: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}"
docker_username: "${{ secrets.DOCKER_USERNAME }}"
docker_password: "${{ secrets.DOCKER_PASSWORD }}"
trivy:
needs:
# - app-version
- build-and-push-image
uses: SierraSystems/reusable-workflows/.github/workflows/trivy-scan-openshift-image.yml@main
with:
imagestream_name: ${{ github.event.inputs.app_name }}
# image_tag: "${{ needs.app-version.outputs.app-version }}"
image_tag: "latest"
secrets:
openshift_external_repository: "${{ secrets.OPENSHIFT_EXTERNAL_REPOSITORY_SILVER }}"
openshift_namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools"
openshift_sa_name: "${{ secrets.OPENSHIFT_SA_PIPELINE_PASSWORD_SILVER }}"
openshift_sa_password: "${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}"
openshift_server_url: "${{ secrets.OPENSHIFT_SERVER_URL_SILVER }}"
openshift_token: "${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}"