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 #429 from bcgov/epdds-270
CI/CD of microfrontends nav/theme/web-ee/root-config
- Loading branch information
Showing
4 changed files
with
331 additions
and
0 deletions.
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,82 @@ | ||
name: forms-flow-web Custom | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
START_BUILD: | ||
required: true | ||
type: boolean | ||
description: This value is ignored, just to trigger dispatch. | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
- epdds-270 # Remove in future, just to verify this works | ||
paths: | ||
- "forms-flow-ai/forms-flow-ai-micro-front-ends/forms-flow-nav" | ||
- ".github/workflows/cd-forms-flow-nav.yaml" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./forms-flow-ai/forms-flow-ai-micro-front-ends/forms-flow-nav | ||
env: | ||
APP_NAME: "forms-flow-nav" | ||
|
||
jobs: | ||
forms-flow-ai-nav-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: forms-flow-web Custom | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
START_BUILD: | ||
required: true | ||
type: boolean | ||
description: This value is ignored, just to trigger dispatch. | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
- epdds-270 # Remove in future, just to verify this works | ||
paths: | ||
- "forms-flow-ai/forms-flow-ai-micro-front-ends/forms-flow-theme" | ||
- ".github/workflows/cd-forms-flow-theme.yaml" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./forms-flow-ai/forms-flow-ai-micro-front-ends/forms-flow-theme | ||
env: | ||
APP_NAME: "forms-flow-theme" | ||
|
||
jobs: | ||
forms-flow-ai-theme-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: forms-flow-web Custom | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
START_BUILD: | ||
required: true | ||
type: boolean | ||
description: This value is ignored, just to trigger dispatch. | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
- epdds-270 # Remove in future, just to verify this works | ||
paths: | ||
- "forms-flow-ai/forms-flow-ai-ee/forms-flow-web" | ||
- ".github/workflows/cd-forms-flow-web-ee.yaml" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./forms-flow-ai/forms-flow-ai-ee/forms-flow-web | ||
env: | ||
APP_NAME: "forms-flow-web-ee" | ||
|
||
jobs: | ||
forms-flow-ai-web-ee-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: forms-flow-web Custom | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
START_BUILD: | ||
required: true | ||
type: boolean | ||
description: This value is ignored, just to trigger dispatch. | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
- epdds-270 # Remove in future, just to verify this works | ||
paths: | ||
- "forms-flow-ai/forms-flow-ai-ee/forms-flow-web-root-config" | ||
- ".github/workflows/cd-forms-flow-web-root-config.yaml" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./forms-flow-ai/forms-flow-ai-ee/forms-flow-web-root-config | ||
env: | ||
APP_NAME: "forms-flow-web-root-config" | ||
|
||
jobs: | ||
forms-flow-ai-web-root-config-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 }}-dev-build -p '{"spec":{"source":{"git":{"ref":"${{ env.BRANCH_NAME }}"}}}}' | ||
- name: Start Build Openshift | ||
shell: bash | ||
run: | | ||
oc start-build ${{ env.APP_NAME }}-dev-build --wait | ||
- name: Tag+Deploy for ${{ env.TAG_NAME }} | ||
shell: bash | ||
run: | | ||
oc tag ${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ env.TAG_NAME }} | ||