-
Notifications
You must be signed in to change notification settings - Fork 4
144 lines (141 loc) · 6.24 KB
/
ui.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build-UI
on:
pull_request:
branches:
- master
paths:
- "forgerock-openbanking-ui/**"
push:
branches:
- master
env:
GITHUB_SHA: ${{ github.sha }}
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: setup node version 10
uses: actions/setup-node@v2
with:
node-version: '10'
- name: Run tests
working-directory: ./forgerock-openbanking-ui
run: |
npm ci
npm run test.ci
./node_modules/@angular/cli/bin/ng lint
- name: Prepare customers
working-directory: ./forgerock-openbanking-ui
run: git clone https://${{ secrets.FORGECLOUD_ACCESS_TOKEN }}@github.com/ForgeCloud/ob-customers.git customers
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: customers
path: forgerock-openbanking-ui/customers
build_bank_ui:
name: Build Bank App
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: prepare version
id: version
run: |
echo "::set-output name=BUILD_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-${GITHUB_SHA::7}"
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: customers
path: forgerock-openbanking-ui/customers
- working-directory: ./forgerock-openbanking-ui
run: cp -R ./customers/* themes/
- name: Build bank docker image
working-directory: ./forgerock-openbanking-ui
run: |
echo "Building docker image eu.gcr.io/openbanking-214714/obri/bank-ui:${{ steps.version.outputs.BUILD_VERSION }}"
echo "${{ secrets.GCR_JSON_KEY_BASE64 }}" | base64 -d | docker login eu.gcr.io -u _json_key --password-stdin
docker build --build-arg BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }} -f projects/bank/docker/Dockerfile -t eu.gcr.io/openbanking-214714/obri/bank-ui:latest -t eu.gcr.io/openbanking-214714/obri/bank-ui:${{ steps.version.outputs.BUILD_VERSION }} .
docker push eu.gcr.io/openbanking-214714/obri/bank-ui:latest
docker push eu.gcr.io/openbanking-214714/obri/bank-ui:${{ steps.version.outputs.BUILD_VERSION }}
build_manual_onboarding:
name: Build Register App
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: prepare version
id: version
run: |
echo "::set-output name=BUILD_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-${GITHUB_SHA::7}"
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: customers
path: forgerock-openbanking-ui/customers
- working-directory: ./forgerock-openbanking-ui
run: cp -R ./customers/* themes/
- name: Build register docker image
working-directory: ./forgerock-openbanking-ui
run: |
echo "Building docker image eu.gcr.io/openbanking-214714/obri/manual-onboarding:${{ steps.version.outputs.BUILD_VERSION }}"
echo "${{ secrets.GCR_JSON_KEY_BASE64 }}" | base64 -d | docker login eu.gcr.io -u _json_key --password-stdin
docker build --build-arg BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }} -f projects/manual-onboarding/docker/Dockerfile -t eu.gcr.io/openbanking-214714/obri/manual-onboarding:latest -t eu.gcr.io/openbanking-214714/obri/manual-onboarding:${{ steps.version.outputs.BUILD_VERSION }} .
docker push eu.gcr.io/openbanking-214714/obri/manual-onboarding:latest
docker push eu.gcr.io/openbanking-214714/obri/manual-onboarding:${{ steps.version.outputs.BUILD_VERSION }}
update_ob_deploy:
name: Update ob-deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: [build_manual_onboarding, build_bank_ui]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: prepare version
id: version
run: |
echo "::set-output name=BUILD_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-${GITHUB_SHA::7}"
- name: Checkout Repo
uses: actions/checkout@v2
with:
repository: "forgeCloud/ob-deploy"
token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }}
path: ob-deploy
- name: Commit ob-deploy version update
if: github.ref == 'refs/heads/master'
working-directory: ./ob-deploy
run: |
jq -M '[ .[] | if ((.service == "bank-ui" or .service == "manual-onboarding") and (.helmReference | contains("obri-helm-charts/ui-template"))) then .version |= "${{ steps.version.outputs.BUILD_VERSION }}" else . end ]' client_releases/master-dev/releases.json > client_releases/master-dev/releases.json.tmp
mv client_releases/master-dev/releases.json.tmp client_releases/master-dev/releases.json
git config --global user.email "codefresh@codefresh.io"
git config --global user.name "Codefresh"
git add client_releases/master-dev/releases.json
git commit --allow-empty -m "Bumping Bank & Register UI version ${{ steps.version.outputs.BUILD_VERSION }}"
- name: Temporarily disable "include administrators" protection
id: disable_include_admins
uses: benjefferies/branch-protection-bot@1.0.9
if: always()
with:
access_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }}
enforce_admins: false
owner: forgeCloud
repo: ob-deploy
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }}
directory: ./ob-deploy
repository: "forgeCloud/ob-deploy"
branch: master
- name: Enable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@1.0.9
if: always()
with:
access_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }}
enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }}
owner: forgeCloud
repo: ob-deploy