-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (115 loc) · 4.73 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
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_directory_ui:
name: Build Directory 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 directory UI docker image
working-directory: ./forgerock-openbanking-ui
run: |
echo "Building docker image eu.gcr.io/openbanking-214714/obri/directory-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/directory/docker/Dockerfile \
-t eu.gcr.io/openbanking-214714/obri/directory-ui:latest -t eu.gcr.io/openbanking-214714/obri/directory-ui:${{ steps.version.outputs.BUILD_VERSION }} .
docker push eu.gcr.io/openbanking-214714/obri/directory-ui:latest
docker push eu.gcr.io/openbanking-214714/obri/directory-ui:${{ steps.version.outputs.BUILD_VERSION }}
update_ob_deploy:
name: Update ob-deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: build_directory_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
working-directory: ./ob-deploy
run: |
jq -M '[ .[] | if (.service == "directory-ui" 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 "[email protected]"
git config --global user.name "Codefresh"
git add client_releases/master-dev/releases.json
git commit --allow-empty -m "Bumping Directory UI version ${{ steps.version.outputs.BUILD_VERSION }}"
- name: Temporarily disable "include administrators" protection
id: disable_include_admins
uses: benjefferies/[email protected]
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/[email protected]
if: always()
with:
access_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }}
enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }}
owner: forgeCloud
repo: ob-deploy