2
2
SCRIPTDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) "
3
3
4
4
# Copy the jenkins file contents the shared library
5
- # Can be used to update the release by setting
5
+ # Can be used to update the release by setting
6
6
# JENKIN_SHARED_LIB_USER=redhat-appstudio
7
7
# JENKIN_SHARED_LIB_BRANCH=main
8
- # For dev the default is MY_GITHUB_USER and dev branch
9
- # see ci-test for branch munging in scripts
8
+ # For dev the default is MY_GITHUB_USER and dev branch
9
+ # see ci-test for branch munging in scripts
10
10
# JENKIN_SHARED_LIB_USER=$MY_GITHUB_USER
11
11
# JENKIN_SHARED_LIB_BRANCH=dev
12
12
@@ -16,26 +16,25 @@ JENKIN_SHARED_LIB_BRANCH=${JENKIN_SHARED_LIB_BRANCH:-dev}
16
16
echo " Updating Jenkins shared lib for $JENKIN_SHARED_LIB_USER in branch $JENKIN_SHARED_LIB_BRANCH "
17
17
18
18
WORKDIR=$( mktemp -d)
19
- JENKINS_SHARED_LIB=$WORKDIR /jenkins-library
20
- REPO=https://github.com/$JENKIN_SHARED_LIB_USER /tssc-sample-jenkins
19
+ JENKINS_SHARED_LIB=$WORKDIR /jenkins-library
20
+ REPO=https://github.com/$JENKIN_SHARED_LIB_USER /tssc-sample-jenkins
21
21
22
22
MULTI_CI=$( pwd)
23
23
GEN_SRC=$MULTI_CI /generated/source-repo
24
24
GEN_GITOPS=$MULTI_CI /generated/gitops-template
25
25
26
- git clone --quiet $REPO $JENKINS_SHARED_LIB
26
+ git clone --quiet $REPO $JENKINS_SHARED_LIB
27
27
cd $JENKINS_SHARED_LIB
28
- if [ ` git rev-parse --verify $JENKIN_SHARED_LIB_BRANCH 2> /dev/null` ]
29
- then
28
+ if [ $( git rev-parse --verify $JENKIN_SHARED_LIB_BRANCH 2> /dev/null) ]; then
30
29
echo " $JENKIN_SHARED_LIB_BRANCH exists"
31
- git checkout $JENKIN_SHARED_LIB_BRANCH
32
- git pull
30
+ git checkout $JENKIN_SHARED_LIB_BRANCH
31
+ git pull
33
32
else
34
33
echo " $JENKIN_SHARED_LIB_BRANCH branch created"
35
34
git checkout -b $JENKIN_SHARED_LIB_BRANCH
36
35
git branch --set-upstream-to=origin/$JENKIN_SHARED_LIB_BRANCH
37
36
fi
38
-
37
+
39
38
# copy scripts and groovy files in to proper locations
40
39
# delete extra files - We should move these outside of ./rhtap
41
40
# so we don't copy extra files by mistake
@@ -45,11 +44,10 @@ cp $MULTI_CI/rhtap.groovy $JENKINS_SHARED_LIB/vars
45
44
# we should consider copying the Jenkins files for gitops and src into a jenkinsfile-samples
46
45
# so the latest Jenkinsfile is up to date in the library
47
46
rm -rf $JENKINS_SHARED_LIB /resources/env.template.sh
48
- rm -rf $JENKINS_SHARED_LIB /resources/signing-secret-env.sh
47
+ rm -rf $JENKINS_SHARED_LIB /resources/signing-secret-env.sh
49
48
git add .
50
49
git commit -m " Jenkins library update from tssc-dev-multi-ci"
51
50
git status
52
- pwd
51
+ pwd
53
52
git pull
54
- git push --set-upstream origin $JENKIN_SHARED_LIB_BRANCH
55
-
53
+ git push --set-upstream origin $JENKIN_SHARED_LIB_BRANCH
0 commit comments