aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/release-jjb-chinook-sources/include-release-jjb-chinook-release-sources-rsync.sh
blob: 2958476b850e1fa5b0b20f3c4e7a0e2c3c00e59f (plain)
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
#!/bin/bash

#set -x
set -e
echo "#######################################"
echo "#######################################"
ls -alh
echo "#######################################"
echo "#######################################"
tree -L 2
echo "#######################################"
echo "#######################################"
set | grep MACHINE
echo "#######################################"
echo "#######################################"
set
echo "#######################################"
echo "#######################################"

cd repoclone/output

export RSYNCDST="jenkins-slave@10.30.72.8:/srv/download/AGL/release/${RELEASE_BRANCH}/${RELEASE_VERSION}/"
export RSYNCSRC=$(pwd)/UPLOAD/

# construct upload folder
mv UPLOAD UPLOAD2 || true
rm -rf UPLOAD2 || true
mkdir -p UPLOAD/${MACHINE}
export DEST=$(pwd)/UPLOAD/${MACHINE}

# save space ... remove the rpms
rm -rf tmp/deploy/rpm || true

rsync -avr --progress --delete tmp/deploy $DEST/
rsync -avr --progress --delete tmp/log $DEST/

cp ../../current_default.xml $DEST/${MACHINE}_repo_default.xml
cp conf/local.conf $DEST/local.conf
cp conf/auto.conf $DEST/auto.conf
echo "$BUILD_URL" > $DEST/jenkins.build.url

tree $DEST

ls -alhR $DEST

echo "would do rsync -avr -e \"ssh -o StrictHostKeyChecking=no\" $RSYNCSRC $RSYNCDST "

if test x"yes" = x"$UPLOAD" ; then
   rsync -avr -e "ssh -o StrictHostKeyChecking=no" $RSYNCSRC $RSYNCDST
fi

exit 0