aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/release-jjb-dab-sources/include-release-jjb-dab-release-sources-rsync.sh
blob: 9b40b5acd3c3b8d004af39a87cf1a26969be5868 (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
#!/bin/bash

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

# construct upload folder


BRANCH=${RELEASE_BRANCH}
RELVER=${RELEASE_VERSION}

rm -rf release-upload || true

git clone -b ${RELEASE_BRANCH} https://gerrit.automotivelinux.org/gerrit/p/staging/release-upload.git
cd release-upload

gpg --keyserver pgp.mit.edu --recv D6DD2170

ls | grep -q agl-${RELEASE_BRANCH}-${RELEASE_VERSION}.tar.bz2

( gpg --verify agl-${RELEASE_BRANCH}-${RELEASE_VERSION}.tar.bz2.sig agl-${RELEASE_BRANCH}-${RELEASE_VERSION}.tar.bz2 2>&1 | grep -e "Good signature.*Jan-Simon.*Moeller.*AGL.*Release" -q && echo "gpg key verification succeeded" ) || ( echo "gpg key verification failed" && exit 1 )

rm -rf ../UPLOAD || true
mkdir -p ../UPLOAD/

cp -ar agl-${RELEASE_BRANCH}-${RELEASE_VERSION}.* ../UPLOAD/

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

if test x"yes" = x"${UPLOAD}" ; then
   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 "mkdir -p ${RSYNCDST}"
   rsync -avr -e "ssh -o StrictHostKeyChecking=no" ${RSYNCSRC}/* ${RSYNCDST}
fi