Commit guppy release jobs for sources and sandbox 89/18689/1
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Tue, 11 Dec 2018 17:51:24 +0000 (18:51 +0100)
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>
Tue, 11 Dec 2018 17:51:24 +0000 (18:51 +0100)
These are working now and can be committed.

Change-Id: I39a979cde74f03cc19f125da82e72de0202b6aba
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
jjb/release-jjb-guppy-release/include-release-jjb-release-move-sandbox.sh [new file with mode: 0644]
jjb/release-jjb-guppy-release/release-jjb-release.yaml [new file with mode: 0644]
jjb/release-jjb-guppy-sources/include-release-jjb-release-sources-rsync.sh [new file with mode: 0644]
jjb/release-jjb-guppy-sources/release-jjb-sources.yaml [new file with mode: 0644]

diff --git a/jjb/release-jjb-guppy-release/include-release-jjb-release-move-sandbox.sh b/jjb/release-jjb-guppy-release/include-release-jjb-release-move-sandbox.sh
new file mode 100644 (file)
index 0000000..2f85a3e
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+#set -x
+set -e
+
+if test x"" = x"${RELEASE_BRANCH}"; then
+    echo "RELEASE_BRANCH invalid"
+    exit 1
+fi
+
+if test x"" = x"${RELEASE_VERSION}"; then
+    echo "RELEASE_VERSION invalid"
+    exit 1
+fi
+
+
+export REMOTESRC="/srv/download/AGL/upload/ci/${RELEASE_BRANCH}/${RELEASE_VERSION}/"
+export REMOTEDST="/srv/download/AGL/release/${RELEASE_BRANCH}/${RELEASE_VERSION}/"
+
+if test x"yes" = x"$UPLOAD" ; then
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 mkdir -p ${REMOTEDST}
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 mv ${REMOTESRC}/* ${REMOTEDST}/
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 rm -r ${REMOTESRC}
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 sh -c "cd /srv/download/AGL/release/${RELEASE_BRANCH}/ ; rm latest ; ln -sf ${RELEASE_VERSION} latest ; echo ${RELEASE_VERSION} > latest.txt"
+fi
+
+exit 0
\ No newline at end of file
diff --git a/jjb/release-jjb-guppy-release/release-jjb-release.yaml b/jjb/release-jjb-guppy-release/release-jjb-release.yaml
new file mode 100644 (file)
index 0000000..3e7b650
--- /dev/null
@@ -0,0 +1,52 @@
+---
+- project:
+    name: release-jjb-guppy-release-from-snapshot
+    jobs:
+      - release-jjb-guppy-release-from-snapshot
+
+- job-template:
+    name: 'release-jjb-guppy-release-from-snapshot'
+    project-type: freestyle
+    concurrent: false
+    node: control-slave
+
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: AGL/AGL-repo
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/tags/guppy_6.99.1
+          description: "refspec to build"
+      - string:
+          name: RELEASE_VERSION
+          default: 6.99.1
+          description: "release version number for build"
+      - string:
+          name: RELEASE_BRANCH
+          default: guppy
+          description: "release branch to build"
+      - string:
+          name: UPLOAD
+          default: yes_or_no
+          description: "Upload?"
+
+    build-discarder:
+      days-to-keep: 30
+      num-to-keep: 40
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    builders:
+      - shell:
+          !include-raw-escape:
+          - include-release-jjb-release-move-sandbox.sh
diff --git a/jjb/release-jjb-guppy-sources/include-release-jjb-release-sources-rsync.sh b/jjb/release-jjb-guppy-sources/include-release-jjb-release-sources-rsync.sh
new file mode 100644 (file)
index 0000000..e458a17
--- /dev/null
@@ -0,0 +1,39 @@
+#!/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 pool.sks-keyservers.net --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="/srv/download/AGL/release/${RELEASE_BRANCH}/"
+
+if test x"yes" = x"${UPLOAD}" ; then
+   set +x
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 "mkdir -p ${RSYNCDST}"
+   rsync -avr -e "ssh -o StrictHostKeyChecking=no" ${RSYNCSRC}/* jenkins-slave@10.30.72.8:${RSYNCDST}
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 "rm -rf ${RSYNCDST}/latest" 
+   ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 "ln -sf ${RELEASE_VERSION} ${RSYNCDST}/latest"
+fi
\ No newline at end of file
diff --git a/jjb/release-jjb-guppy-sources/release-jjb-sources.yaml b/jjb/release-jjb-guppy-sources/release-jjb-sources.yaml
new file mode 100644 (file)
index 0000000..a4332f9
--- /dev/null
@@ -0,0 +1,40 @@
+---
+- project:
+    name: release-jjb-guppy-sources
+    jobs:
+      - release-jjb-guppy-sources
+
+- job-template:
+    name: 'release-jjb-guppy-sources'
+    project-type: freestyle
+    concurrent: false
+    node: agl-test-slave
+
+    parameters:
+      - string:
+          name: RELEASE_VERSION
+          default: 6.99.1
+          description: "release version number for build"
+      - string:
+          name: RELEASE_BRANCH
+          default: guppy
+          description: "release branch to build"
+      - string:
+          name: UPLOAD
+          default: yes_or_no
+          description: "Upload?"
+
+    build-discarder:
+      days-to-keep: 30
+      num-to-keep: 40
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    builders:
+      - shell:
+          !include-raw-escape:
+          - include-release-jjb-release-sources-rsync.sh