File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,8 @@ spec:
153
153
value: /home/devops
154
154
- name: ENVIRONMENT_NAME
155
155
value: ${ env.NAMESPACE}
156
+ - name: BRANCH
157
+ value: ${ branch}
156
158
- name: trigger-cd
157
159
image: docker.io/garagecatalyst/ibmcloud-dev:1.0.10
158
160
tty: true
@@ -175,7 +177,7 @@ spec:
175
177
checkout scm
176
178
stage(' Build' ) {
177
179
sh ''' #!/bin/bash
178
- npm install
180
+ npm install --unsafe-perm
179
181
npm run build --if-present
180
182
'''
181
183
}
@@ -253,6 +255,7 @@ spec:
253
255
254
256
echo "IMAGE_VERSION=$(git describe --abbrev=0 --tags)" > ./env-config
255
257
echo "IMAGE_NAME=$(basename -s .git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')" >> ./env-config
258
+ echo "REPO_URL=$(git config --get remote.origin.url)" >> ./env-config
256
259
257
260
cat ./env-config
258
261
'''
@@ -323,6 +326,8 @@ spec:
323
326
cat ${CHART_PATH}/values.yaml | \
324
327
yq w - nameOverride "${IMAGE_NAME}" | \
325
328
yq w - fullnameOverride "${IMAGE_NAME}" | \
329
+ yq w - vcsInfo.repoUrl "${REPO_URL}" | \
330
+ yq w - vcsInfo.branch "${BRANCH}" | \
326
331
yq w - image.repository "${IMAGE_REPOSITORY}" | \
327
332
yq w - image.tag "${IMAGE_VERSION}" | \
328
333
yq w - ingress.enabled "${INGRESS_ENABLED}" | \
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ apiVersion: apps/v1
2
2
kind : Deployment
3
3
metadata :
4
4
name : {{ include "starter-kit.fullname" . }}
5
+ {{- if and .Values.vcsInfo.repoUrl .Values.vcsInfo.branch }}
6
+ annotations :
7
+ app.openshift.io/vcs-ref : {{ .Values.vcsInfo.branch }}
8
+ app.openshift.io/vcs-uri : {{ .Values.vcsInfo.repoUrl }}
9
+ {{- end }}
5
10
labels :
6
11
app.kubernetes.io/name : {{ include "starter-kit.name" . }}
7
12
helm.sh/chart : {{ include "starter-kit.chart" . }}
Original file line number Diff line number Diff line change @@ -35,3 +35,7 @@ ingress:
35
35
path : " /"
36
36
37
37
# tlsSecretName: ""
38
+
39
+ vcsInfo :
40
+ repoUrl : " "
41
+ branch : " "
You can’t perform that action at this time.
0 commit comments