-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins_resy.sh
executable file
·46 lines (38 loc) · 1.14 KB
/
jenkins_resy.sh
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
# That's what we could call from Jenkins:
#
# rm -f jenkins_resy.sh*
# wget --no-cache https://raw.githubusercontent.com/RobertBerger/manifests/master/jenkins_resy.sh
# chmod +x jenkins_resy.sh
# ./jenkins_resy.sh
#
# Jenkins:
# WORKSPACE
# The absolute path of the directory assigned to the build as a workspace.
#
# We need a symlink from /workspace to our jenkins ${WORKSPACE}
HERE=$(pwd)
if [ ! -L /workdir ] ; then
echo "+ symlink /workdir does not exist"
echo "+ sudo ln -sf ${WORKSPACE} /workdir"
sudo ln -sf ${WORKSPACE} /workdir
fi
if [ "$(readlink -- "/workdir")" = ${WORKSPACE} ]; then
echo "all good!"
echo "we have a symlink /workdir pointing to ${WORKSPACE}"
else
echo "not good!"
echo "+ ls -lah /workdir"
ls -lah /workdir
echo "WORKSPACE: ${WORKSPACE}"
fi
cd /workdir
# run the resy stuff (get layers)
echo "+ rm -f resy.sh*"
rm -f resy.sh*
echo "+ wget --no-cache https://raw.githubusercontent.com/RobertBerger/manifests/master/resy.sh"
wget --no-cache https://raw.githubusercontent.com/RobertBerger/manifests/master/resy.sh
echo "+ chmod +x resy.sh"
chmod +x resy.sh
echo "+ ./resy.sh"
./resy.sh
cd ${HERE}