-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (141 loc) · 5.9 KB
/
ui-release.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 Release
on:
release:
types: [ published ]
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
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_auth:
name: Build Auth App
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: prepare version
id: version
run: |
export VERSION=${RELEASE_VERSION}-${GITHUB_SHA::7}
echo "::set-output name=BUILD_VERSION::$VERSION"
- 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 auth docker image
working-directory: ./forgerock-openbanking-ui
run: |
export BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }}
echo "Building docker image eu.gcr.io/openbanking-214714/obri/auth-ui:${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=$BUILD_VERSION -f projects/auth/docker/Dockerfile \
-t eu.gcr.io/openbanking-214714/obri/auth-ui:latest -t eu.gcr.io/openbanking-214714/obri/auth-ui:$BUILD_VERSION .
docker push eu.gcr.io/openbanking-214714/obri/auth-ui:latest
docker push eu.gcr.io/openbanking-214714/obri/auth-ui:$BUILD_VERSION
build_swagger:
name: Build Swagger App
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: prepare version
id: version
run: |
export VERSION=${RELEASE_VERSION}-${GITHUB_SHA::7}
echo "::set-output name=BUILD_VERSION::$VERSION"
- 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 swagger docker image
working-directory: ./forgerock-openbanking-ui
run: |
export BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }}
echo "Building docker image eu.gcr.io/openbanking-214714/obri/swagger-ui:${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=$BUILD_VERSION -f projects/swagger/docker/Dockerfile \
-t eu.gcr.io/openbanking-214714/obri/swagger-ui:latest -t eu.gcr.io/openbanking-214714/obri/swagger-ui:$BUILD_VERSION .
docker push eu.gcr.io/openbanking-214714/obri/swagger-ui:latest
docker push eu.gcr.io/openbanking-214714/obri/swagger-ui:$BUILD_VERSION
update_ob_deploy:
name: Update ob-deploy
runs-on: ubuntu-latest
needs: [build_auth, build_swagger]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- working-directory: ./forgerock-openbanking-ui
id: version
run: |
export VERSION=${RELEASE_VERSION}-${GITHUB_SHA::7}
echo "::set-output name=BUILD_VERSION::$VERSION"
- 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 == "auth-ui" or .service == "swagger-ui") and (.helmReference | contains("obri-helm-charts/ui-template"))) then .version |= "${{ steps.version.outputs.BUILD_VERSION }}" else . end ]' releases-published.json > releases-published.json.tmp
mv releases-published.json.tmp releases-published.json
git config --global user.email "codefresh@codefresh.io"
git config --global user.name "Codefresh"
git add releases-published.json
git commit --allow-empty -m "Bumping Auth UI & Swagger UI version ${{ steps.version.outputs.BUILD_VERSION }}"
- name: Temporarily disable "include administrators" protection
id: disable_include_admins
uses: benjefferies/branch-protection-bot@1.0.7
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.7
if: always()
with:
access_token: ${{ secrets.FORGECLOUD_ACCESS_TOKEN }}
enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }}
owner: forgeCloud
repo: ob-deploy