generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #510 from bcgov/feat/task-228
Feat/task 228
- Loading branch information
Showing
22 changed files
with
804 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: forms-flow-bpm Custom | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
START_BUILD: | ||
required: true | ||
type: boolean | ||
description: This value is ignored, just to trigger dispatch. | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
- feat/task-228 # Remove in future, just to verify this works | ||
paths: | ||
- "forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm" | ||
- ".github/workflows/cd-forms-flow-bpm.yaml" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm | ||
env: | ||
APP_NAME: "forms-flow-bpm" | ||
|
||
jobs: | ||
forms-flow-ai-bpm-cd-by-push: | ||
runs-on: ubuntu-20.04 | ||
|
||
if: github.repository == 'bcgov/nr-epd-digital-services' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set ENV variables | ||
id: set-variable | ||
# make sure to update the TOOLS_NAME once all the environment for forms-flow-ai-web is ready | ||
run: | | ||
if [ '${{ github.ref_name }}' == 'dev' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OC_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="dev"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV | ||
echo "ENV_NAME="dev"" >> $GITHUB_ENV | ||
elif [ '${{ github.ref_name }}' == 'main' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OC_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="test"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="main"" >> $GITHUB_ENV | ||
echo "ENV_NAME="test"" >> $GITHUB_ENV | ||
else | ||
echo "For ${{ github.ref_name }} branch, defaulting to dev values" | ||
echo "TOOLS_NAME=${{secrets.OC_NAMESPACE_NAMEPLATE}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="dev"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
|
||
- name: Login Openshift | ||
shell: bash | ||
run: | | ||
oc login --server=${{secrets.OC_SERVER}} --token=${{secrets.OC_TOKEN}} | ||
- name: Tools project | ||
shell: bash | ||
run: | | ||
oc project ${{ secrets.OC_NAMESPACE_NAMEPLATE }}-tools | ||
# Build from either dev or main branch as appropriate | ||
- name: Build from ${{ env.BRANCH_NAME }} branch | ||
shell: bash | ||
run: | | ||
oc patch bc/${{ env.APP_NAME }}-build -p '{"spec":{"source":{"git":{"ref":"${{ env.BRANCH_NAME }}"}}}}' | ||
- name: Start Build Openshift | ||
shell: bash | ||
run: | | ||
oc start-build ${{ env.APP_NAME }}-build --wait | ||
- name: Tag+Deploy for ${{ env.TAG_NAME }} | ||
shell: bash | ||
run: | | ||
oc tag ${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ env.TAG_NAME }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
push: | ||
branches: | ||
- 'dev' | ||
- 'feat/task-228' #test1 | ||
|
||
paths: | ||
- 'backend/**' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Modified by Yichun Zhao and Walter Moar | ||
|
||
|
||
# Maven build | ||
FROM maven:3.8.1-openjdk-17-slim AS MAVEN_TOOL_CHAIN | ||
RUN apt-get update \ | ||
&& apt-get install -y git | ||
|
||
# expect a build-time variable | ||
ARG FORMFLOW_SOURCE_REPO_BRANCH | ||
# use the value to set the ENV var default | ||
ENV FORMFLOW_SOURCE_REPO_BRANCH v5.1.0 | ||
# expect a build-time variable | ||
ARG FORMFLOW_SOURCE_REPO_URL | ||
# use the value to set the ENV var default | ||
ENV FORMFLOW_SOURCE_REPO_URL https://github.com/AOT-Technologies/forms-flow-ai | ||
|
||
# Clone code | ||
RUN git clone -b ${FORMFLOW_SOURCE_REPO_BRANCH} ${FORMFLOW_SOURCE_REPO_URL} /bpm/ | ||
|
||
RUN cp /bpm/forms-flow-bpm/pom*.xml /tmp/ | ||
RUN cp /bpm/forms-flow-bpm/settings-docker.xml /usr/share/maven/ref/ | ||
#RUN cp -r /tmp/forms-flow-ai/forms-flow-bpm/. /forms-flow-bpm/ | ||
WORKDIR /tmp/ | ||
# This allows Docker to cache most of the maven dependencies | ||
RUN mvn -s /usr/share/maven/ref/settings-docker.xml dependency:resolve-plugins dependency:resolve dependency:go-offline -B | ||
RUN cp -r /bpm/forms-flow-bpm/src/ /tmp/src/ | ||
|
||
#Copy custom files for EPD | ||
COPY ./templates /tmp/src/main/resources/templates | ||
COPY ./processes /tmp/src/main/resources/processes | ||
|
||
RUN mvn -s /usr/share/maven/ref/settings-docker.xml package -P default | ||
|
||
# Final custom slim java image (for apk command see 17-jdk-alpine-slim) | ||
FROM openjdk:17-jdk-alpine | ||
|
||
ENV JAVA_VERSION=17-ea+14 | ||
ENV JAVA_HOME=/opt/java/openjdk-17\ | ||
PATH="/opt/java/openjdk-17/bin:$PATH" | ||
|
||
EXPOSE 8080 | ||
# OpenShift has /app in the image, but it's missing when doing local development - Create it when missing | ||
RUN test ! -d /app && mkdir /app || : | ||
# Add spring boot application | ||
RUN mkdir -p /app | ||
COPY --from=MAVEN_TOOL_CHAIN /tmp/target/forms-flow-bpm.jar ./app | ||
RUN chmod a+rwx -R /app | ||
WORKDIR /app | ||
VOLUME /tmp | ||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom", "-Dpolyglot.js.nashorn-compat=true", "-Dpolyglot.engine.WarnInterpreterOnly=false", "-jar","/app/forms-flow-bpm.jar"] |
89 changes: 89 additions & 0 deletions
89
forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Author: Yichun Zhao | ||
version: "3.7" | ||
services: | ||
forms-flow-bpm-db: | ||
image: postgres:latest | ||
environment: | ||
POSTGRES_USER: ${CAMUNDA_JDBC_USER:-admin} | ||
POSTGRES_PASSWORD: ${CAMUNDA_JDBC_PASSWORD:-changeme} | ||
POSTGRES_DB: ${CAMUNDA_JDBC_DB_NAME:-formsflow-bpm} | ||
volumes: | ||
- ./postgres/camunda:/var/lib/postgresql/data | ||
ports: | ||
- '5432:5432' | ||
restart: unless-stopped | ||
networks: | ||
- forms-flow-bpm-network | ||
|
||
forms-flow-bpm: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
restart: always | ||
links: | ||
- forms-flow-bpm-db | ||
ports: | ||
- '8000:8080' | ||
environment: | ||
- KEYCLOAK_URL=${KEYCLOAK_URL} | ||
- KEYCLOAK_URL_REALM=${KEYCLOAK_URL_REALM:-forms-flow-ai} | ||
- KEYCLOAK_CLIENTID=${KEYCLOAK_BPM_CLIENT_ID:-forms-flow-bpm} | ||
- KEYCLOAK_CLIENTSECRET=${KEYCLOAK_BPM_CLIENT_SECRET:-e4bdbd25-1467-4f7f-b993-bc4b1944c943} | ||
- CAMUNDA_JDBC_URL=${CAMUNDA_JDBC_URL:-jdbc:postgresql://forms-flow-bpm-db:5432/formsflow-bpm} | ||
- CAMUNDA_JDBC_USER=${CAMUNDA_JDBC_USER:-admin} | ||
- CAMUNDA_JDBC_PASSWORD=${CAMUNDA_JDBC_PASSWORD:-changeme} | ||
- CAMUNDA_JDBC_DRIVER=${CAMUNDA_JDBC_DRIVER:-org.postgresql.Driver} | ||
# - CAMUNDA_HIKARI_CONN_TIMEOUT=${CAMUNDA_HIKARI_CONN_TIMEOUT} | ||
# - CAMUNDA_HIKARI_IDLE_TIMEOUT=${CAMUNDA_HIKARI_IDLE_TIMEOUT} | ||
# - CAMUNDA_HIKARI_MAX_POOLSIZE=${CAMUNDA_HIKARI_MAX_POOLSIZE} | ||
# - CAMUNDA_HIKARI_VALID_TIMEOUT=${CAMUNDA_HIKARI_VALID_TIMEOUT} | ||
# - CAMUNDA_BPM_HISTORY_LEVEL=${CAMUNDA_BPM_HISTORY_LEVEL} | ||
# - CAMUNDA_AUTHORIZATION_FLAG=${CAMUNDA_AUTHORIZATION_FLAG} | ||
# - CAMUNDA_AUTHORIZATION_REVOKE_CHECK_FLAG=${CAMUNDA_AUTHORIZATION_REVOKE_CHECK_FLAG} | ||
# - CAMUNDA_JOB_CORE_POOL_SIZE=${CAMUNDA_JOB_CORE_POOL_SIZE} | ||
# - CAMUNDA_JOB_LOCK_TIME_MILLIS=${CAMUNDA_JOB_LOCK_TIME_MILLIS} | ||
# - CAMUNDA_JOB_MAXJOBS_PER_ACQUISITION=${CAMUNDA_JOB_MAXJOBS_PER_ACQUISITION} | ||
# - CAMUNDA_JOB_MAX_POOL_SIZE=${CAMUNDA_JOB_MAX_POOL_SIZE} | ||
# - CAMUNDA_JOB_QUEUE_SIZE=${CAMUNDA_JOB_QUEUE_SIZE} | ||
# - CAMUNDA_JOB_WAIT_TIME_MILLIS=${CAMUNDA_JOB_WAIT_TIME_MILLIS} | ||
# - CAMUNDA_JOB_MAX_WAIT=${CAMUNDA_JOB_MAX_WAIT} | ||
# - CAMUNDA_METRICS_FLAG=${CAMUNDA_METRICS_FLAG} | ||
- CAMUNDA_APP_ROOT_LOG_FLAG=${CAMUNDA_APP_ROOT_LOG_FLAG:-error} | ||
- FORMSFLOW_API_URL=${FORMSFLOW_API_URL} | ||
- FORMIO_URL=${FORMIO_DEFAULT_PROJECT_URL} | ||
- FORMIO_ROOT_EMAIL=${FORMIO_ROOT_EMAIL:[email protected]} | ||
- FORMIO_ROOT_PASSWORD=${FORMIO_ROOT_PASSWORD:-changeme} | ||
- APP_SECURITY_ORIGIN=${APP_SECURITY_ORIGIN:-*} | ||
- WEBSOCKET_SECURITY_ORIGIN=${WEBSOCKET_SECURITY_ORIGIN} | ||
- WEBSOCKET_MESSAGE_TYPE=${WEBSOCKET_MESSAGE_TYPE:-TASK_EVENT} | ||
- WEBSOCKET_ENCRYPT_KEY=${WEBSOCKET_ENCRYPT_KEY:-giert989jkwrgb@DR55} | ||
- DATA_BUFFER_SIZE=${DATA_BUFFER_SIZE:-2} | ||
- IDENTITY_PROVIDER_MAX_RESULT_SIZE=${IDENTITY_PROVIDER_MAX_RESULT_SIZE:-250} | ||
- KEYCLOAK_WEB_CLIENTID=${KEYCLOAK_WEB_CLIENTID:-} | ||
- KEYCLOAK_ENABLE_CLIENT_AUTH=${KEYCLOAK_ENABLE_CLIENT_AUTH:-false} | ||
- BPM_CLIENT_CONN_TIMEOUT=${BPM_CLIENT_CONN_TIMEOUT:-5000} | ||
- DATA_ANALYSIS_URL=${DATA_ANALYSIS_URL} | ||
- CUSTOM_SUBMISSION_URL=${CUSTOM_SUBMISSION_URL} | ||
- CUSTOM_SUBMISSION_ENABLED=${CUSTOM_SUBMISSION_ENABLED:-false} | ||
- MULTI_TENANCY_ENABLED=${MULTI_TENANCY_ENABLED:-false} | ||
- FORMSFLOW_ADMIN_URL=${FORMSFLOW_ADMIN_URL:-} | ||
- REDIS_ENABLED=${REDIS_ENABLED:-false} | ||
- REDIS_HOST=${REDIS_HOST} | ||
- REDIS_PORT=${REDIS_PORT:-6379} | ||
- REDIS_PASSCODE=${REDIS_PASSCODE:-changeme} | ||
- SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-false} | ||
- CHES_CLIENT_ID=CDACC9DF-68BE85E6452 | ||
- CHES_SECRET=56b613b2-fbf8-481a-b464-38967c66e066 | ||
- CHES_AUTH_URL=https://dev.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token | ||
- CHES_HOST_URL=https://ches-dev.api.gov.bc.ca | ||
|
||
networks: | ||
- forms-flow-bpm-network | ||
|
||
|
||
networks: | ||
forms-flow-bpm-network: | ||
driver: "bridge" | ||
|
||
volumes: | ||
postgres: |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.