@@ -75,13 +75,15 @@ spec:
75
75
secretKeyRef:
76
76
name: git-credentials
77
77
key: username
78
+ optional: true
78
79
- name: GIT_AUTH_PWD
79
80
valueFrom:
80
81
secretKeyRef:
81
82
name: git-credentials
82
83
key: password
84
+ optional: true
83
85
- name: buildah
84
- image: quay.io/buildah/stable:v1.9.2
86
+ image: quay.io/buildah/stable:v1.9.0
85
87
tty: true
86
88
command: ["/bin/bash"]
87
89
workingDir: ${ workingDir}
@@ -208,10 +210,16 @@ spec:
208
210
set -x
209
211
set -e
210
212
211
- git fetch origin ${BRANCH} --tags
213
+ git config --local credential.helper "!f() { echo username=\\ $GIT_AUTH_USER; echo password=\\ $GIT_AUTH_PWD; }; f"
214
+
215
+ git fetch --unshallow
216
+ git fetch --tags
212
217
git checkout ${BRANCH}
213
218
git branch --set-upstream-to=origin/${BRANCH} ${BRANCH}
214
219
220
+ git config --global user.name "Jenkins Pipeline"
221
+ git config --global user.email "[email protected] "
222
+
215
223
if [[ "${BRANCH}" == "master" ]] && [[ $(git describe --tag `git rev-parse HEAD`) =~ (^[0-9]+.[0-9]+.[0-9]+$) ]] || \
216
224
[[ $(git describe --tag `git rev-parse HEAD`) =~ (^[0-9]+.[0-9]+.[0-9]+-${BRANCH}[.][0-9]+$) ]]
217
225
then
@@ -221,10 +229,6 @@ spec:
221
229
exit 0
222
230
fi
223
231
224
- git config --global user.name "Jenkins Pipeline"
225
- git config --global user.email "[email protected] "
226
- git config --local credential.helper "!f() { echo username=\\ $GIT_AUTH_USER; echo password=\\ $GIT_AUTH_PWD; }; f"
227
-
228
232
mkdir -p ~/.npm
229
233
npm config set prefix ~/.npm
230
234
export PATH=$PATH:~/.npm/bin
@@ -241,8 +245,8 @@ spec:
241
245
--verbose \
242
246
-VV
243
247
244
- echo "IMAGE_NAME =$(basename -s . git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g' )" > ./env-config
245
- echo "IMAGE_VERSION =$(git describe --abbrev=0 --tags )" >> ./env-config
248
+ echo "IMAGE_VERSION =$(git describe --abbrev=0 --tags )" > ./env-config
249
+ echo "IMAGE_NAME =$(basename -s . git `git config --get remote.origin.url` | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g' )" >> ./env-config
246
250
247
251
cat ./env-config
248
252
'''
@@ -336,7 +340,6 @@ spec:
336
340
}
337
341
stage(' Health Check' ) {
338
342
sh ''' #!/bin/bash
339
- set +x
340
343
. ./env-config
341
344
342
345
if [[ "${CLUSTER_TYPE}" == "openshift" ]]; then
@@ -370,8 +373,8 @@ spec:
370
373
. ./env-config
371
374
372
375
if [[ -z "${ARTIFACTORY_ENCRYPT}" ]]; then
373
- echo "Encryption key not available for Jenkins pipeline, please add it to the artifactory-access"
374
- exit 0
376
+ echo "Encrption key not available for Jenkins pipeline, please add it to the artifactory-access"
377
+ exit 1
375
378
fi
376
379
377
380
# Check if a Generic Local Repo has been created and retrieve the URL for it
0 commit comments