Skip to content

Commit

Permalink
Merge pull request #34 from AOT-Technologies/caseflow-ci-cd
Browse files Browse the repository at this point in the history
Caseflow ci cd
  • Loading branch information
sakthi-aot authored Mar 19, 2024
2 parents 1e34b63 + a67a64b commit 249858f
Show file tree
Hide file tree
Showing 11 changed files with 356 additions and 488 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/caseflow_core.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/caseflow_gateway.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/caseflow_gateway_os.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: caseflow gateway openshift build

on:
workflow_dispatch:
inputs:
START_BUILD:
required: true
type: boolean
description: This value is ignored, just to trigger dispatch.
environment:
description: "Environment"
required: true
type: environment
push:
branches:
- dev
- master

# paths:
# #- 'app/**'
# # - 'frontend/**'
# # - 'forms-flow-ai/**'
# # - '.github/workflows/**'

defaults:
run:
shell: bash
working-directory: ./app/caseflow_core/microservices/gateway
env:
APP_NAME: "caseflow-gateway"

jobs:
caseflow-gateway-push:
runs-on: ubuntu-20.04
environment: ${{ inputs.environment }}

# if: github.repository == 'github.com/aot-technologies/case-flow-ai-case-management'
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 }}' == 'master' ]; 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="master"" >> $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
echo "ENV_NAME="tools"" >> $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 ${{ github.ref_name }} branch
shell: bash
run: |
oc patch bc/${{ env.APP_NAME }}-build -p '{"spec":{"source":{"git":{"ref":"${{ github.ref_name }}"}}}}'
- name: Start Build Openshift
shell: bash
run: |
oc start-build ${{ env.APP_NAME }}-build --wait
- name: Tag+Deploy for ${{ inputs.environment }}
shell: bash
run: |
oc tag ${{ env.APP_NAME }}-build:latest ${{ env.APP_NAME }}:${{ inputs.environment }}
71 changes: 0 additions & 71 deletions .github/workflows/caseflow_lob.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/caseflow_lob_os.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: caseflow lob openshift build

on:
workflow_dispatch:
inputs:
START_BUILD:
required: true
type: boolean
description: This value is ignored, just to trigger dispatch.
environment:
description: "Environment"
required: true
type: environment
push:
branches:
- dev
- master

# paths:
# #- 'app/**'
# # - 'frontend/**'
# # - 'forms-flow-ai/**'
# # - '.github/workflows/**'

defaults:
run:
shell: bash
working-directory: ./app/caseflow_core/microservices/lob
env:
APP_NAME: "caseflow-lob"

jobs:
caseflow-lob-push:
runs-on: ubuntu-20.04
environment: ${{ inputs.environment }}

# if: github.repository == 'github.com/aot-technologies/case-flow-ai-case-management'
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 }}' == 'master' ]; 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="master"" >> $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
echo "ENV_NAME="tools"" >> $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 ${{ github.ref_name }} branch
shell: bash
run: |
oc patch bc/${{ env.APP_NAME }}-build -p '{"spec":{"source":{"git":{"ref":"${{ github.ref_name }}"}}}}'
- name: Start Build Openshift
shell: bash
run: |
oc start-build ${{ env.APP_NAME }}-build --wait
- name: Tag+Deploy for ${{ inputs.environment }}
shell: bash
run: |
oc tag ${{ env.APP_NAME }}-build:latest ${{ env.APP_NAME }}:${{ inputs.environment }}
Loading

0 comments on commit 249858f

Please sign in to comment.