Add new ci jobs using multijob and control slave. 69/8369/2
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Wed, 25 Jan 2017 22:30:06 +0000 (23:30 +0100)
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>
Wed, 25 Jan 2017 22:41:56 +0000 (23:41 +0100)
Change-Id: I4cbfe33ec05b4de1558834a902fe7b55bea4c31e
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
14 files changed:
jjb/common/.include-agl-build.sh [moved from jjb/common/include-agl-build.sh with 100% similarity]
jjb/common/include-agl-auto-conf-cvscheck.sh [new file with mode: 0644]
jjb/common/include-agl-bitbake-image-fake.sh [new file with mode: 0644]
jjb/common/include-agl-cd-repoclone-output.sh [new file with mode: 0644]
jjb/common/include-agl-local-conf-cvscheck.sh [new file with mode: 0644]
jjb/common/include-agl-repo.sh
jjb/common/include-agl-run-test-prepare.sh [new file with mode: 0644]
jjb/common/include-agl-run-test-rsync-changeid.sh [new file with mode: 0644]
jjb/common/include-agl-run-test-short.sh [new file with mode: 0644]
jjb/common/include-agl-run-test-snapshot.sh [deleted file]
jjb/global-macros.yaml
jjb/release-jjb-blowfish-snapshot/include-release-jjb-blowfish-snapshot-build.sh [changed from symlink to file mode: 0644]
jjb/sandbox-ci-jjb/sandbox-ci-jjb.yaml [new file with mode: 0644]
jjb/test-lava/test-lava.yaml

diff --git a/jjb/common/include-agl-auto-conf-cvscheck.sh b/jjb/common/include-agl-auto-conf-cvscheck.sh
new file mode 100644 (file)
index 0000000..a5dc135
--- /dev/null
@@ -0,0 +1,15 @@
+# (c) 2017 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Add archiver
+################################################################################
+
+# only morty and newer support the cve-check, so check for master branch
+
+if [ x"master" = x"$GERRIT_BRANCH" ] ; then
+
+# archive sources within  tmp/deploy/
+echo '' >> conf/auto.conf
+echo 'INHERIT += "cve-check"' >> conf/auto.conf
+fi
\ No newline at end of file
diff --git a/jjb/common/include-agl-bitbake-image-fake.sh b/jjb/common/include-agl-bitbake-image-fake.sh
new file mode 100644 (file)
index 0000000..47eca23
--- /dev/null
@@ -0,0 +1,37 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## bitbake the image
+################################################################################
+
+# finally, build the agl-demo-platform (we retry to catch the tar-native bug)
+#( ( bitbake $TARGETIMAGE ) || ( echo '## Failed once, retry ..  ##' ; sync ; sleep 2 ;  bitbake $TARGETIMAGE ) ) || ( echo '## Failed again, bail out ...' ; exit 1 ) 
+
+if [ x"${MACHINE}" = x"raspberrypi3" ] ; then
+export DEVICE_TYPE=raspberrypi3-uboot
+export DEVICE_NAME=raspberrypi3
+export DEVICE_DTB=uImage-bcm2710-rpi-3-b.dtb
+export DEVICE_KERNEL=uImage
+export DEVICE_INITRAMFS=initramfs-netboot-image-raspberrypi3.ext4.gz.u-boot
+export DEVICE_NBDROOT=agl-demo-platform-raspberrypi3.ext4
+else
+    echo "This fake build script is for raspberrypi3 only."
+    exit 1
+fi
+
+
+mkdir -p tmp/deploy/images/${MACHINE}/
+
+pushd tmp/deploy/images/${MACHINE}/
+
+for i in DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT ; do
+    eval curl -o "$(echo "$"${i})" "http://download-new.automotivelinux.org/AGL/snapshots/master/2017-01-08-b241/${MACHINE}/deploy/images/${MACHINE}/$(echo "$"${i})"
+    ls -alh 
+done
+
+ls -alh
+
+popd
+
+du -hs tmp/deploy/*
diff --git a/jjb/common/include-agl-cd-repoclone-output.sh b/jjb/common/include-agl-cd-repoclone-output.sh
new file mode 100644 (file)
index 0000000..56e8b53
--- /dev/null
@@ -0,0 +1,3 @@
+cd repoclone
+export REPODIR=`pwd`
+cd output
diff --git a/jjb/common/include-agl-local-conf-cvscheck.sh b/jjb/common/include-agl-local-conf-cvscheck.sh
new file mode 100644 (file)
index 0000000..d574171
--- /dev/null
@@ -0,0 +1,16 @@
+# (c) 2017 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Add archiver
+################################################################################
+
+# only morty and newer support the cve-check, so check for master branch
+
+if [ x"master" = x"$GERRIT_BRANCH" ] ; then
+
+# archive sources within  tmp/deploy/
+echo '' >> conf/local.conf
+echo 'INHERIT += "cve-check"' >> conf/local.conf
+
+fi
\ No newline at end of file
index 6b21b80..fc85e6b 100644 (file)
@@ -16,6 +16,8 @@ mv repoclone repoclone$XTMP || true
 mkdir -p repoclone
 cd repoclone
 
+export REPODIR=`pwd`
+
 repo init --reference=/opt/AGL/preclone -q -b $TARGETBRANCH -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
 
 # next: repo sync and dump manifest
diff --git a/jjb/common/include-agl-run-test-prepare.sh b/jjb/common/include-agl-run-test-prepare.sh
new file mode 100644 (file)
index 0000000..1c0594e
--- /dev/null
@@ -0,0 +1,76 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Run SHORT CI test
+################################################################################
+set -x
+
+ls -alh
+pwd
+set
+
+cd $REPODIR
+
+#### Find out if machine can be tested.
+#### We keep a stamp file in meta-agl/templates/machine/$MACHINE/test
+if [ ! -d meta-agl/templates/machine/${MACHINE}/test ]; then
+  echo "No HW test templates for ${MACHINE} configured."
+  echo "Add meta-agl/templates/machine/${MACHINE}/test/ and its contents to enable"
+  exit 0
+fi
+
+if [ ! -f meta-agl/templates/machine/${MACHINE}/test/hwtest.enable ] ; then 
+  echo "No HW test for ${MACHINE} configured."
+  echo "Add meta-agl/templates/machine/${MACHINE}/test/hwtest.enable to enable"
+  exit 0
+fi
+
+if [ ! -f meta-agl/templates/machine/${MACHINE}/test/hwtest.short.enable ] ; then
+  echo "No short HW test for ${MACHINE} configured."
+  echo "Add meta-agl/templates/machine/${MACHINE}/test/hwtest.enable.short to enable"
+else
+  eval export ENVFILE=meta-agl/templates/machine/${MACHINE}/test/hwtest.short.environment
+  eval export TESTJOBFILE=meta-agl/templates/machine/${MACHINE}/test/testjob_short.yaml
+fi
+
+if [ ! -f $ENVFILE ] ; then
+  echo "No short HW test environment file available for ${MACHINE}."
+  echo "Add ${ENVFILE} to enable."
+  exit 1
+fi
+
+if [ ! -e $TESTJOBFILE ] ; then
+  echo "No short HW test environment file available for ${MACHINE}."
+  echo "Add ${TESTJOBFILE} to enable."
+  exit 1
+fi
+
+# some defaults
+export DEVICE_TYPE=raspberrypi3-uboot
+export DEVICE_NAME=raspberrypi3
+export DEVICE_DTB=uImage-bcm2710-rpi-3-b.dtb
+export DEVICE_KERNEL=uImage
+export DEVICE_INITRAMFS=initramfs-netboot-image-raspberrypi3.ext4
+export DEVICE_NBDROOT=agl-demo-platform-raspberrypi3.ext4
+export DEVICE_NBDROOT_COMPRESSION=none
+export DEVICE_BOOT_METHOD=u-boot
+export DEVICE_BOOT_TYPE=bootm
+export DEVICE_URL_PREFIX='https://download.automotivelinux.org/AGL/upload/ci/'
+
+
+# import device defaults. Format 'a=b'
+for i in DEVICE_TYPE DEVICE_NAME DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT DEVICE_NBDROOT_COMPRESSION DEVICE_BOOT_METHOD DEVICE_BOOT_TYPE; do
+    if grep -q $i $ENVFILE ; then
+        X=$(grep $i $ENVFILE | sed -e "s#${i}=##g" -e "s#;.*##g")
+        eval export ${i}=${X}
+    fi
+done
+
+echo "Resulting values:"
+set | grep DEVICE_
+
+
+# echo NEXT is rsync
+#exit 0
+
diff --git a/jjb/common/include-agl-run-test-rsync-changeid.sh b/jjb/common/include-agl-run-test-rsync-changeid.sh
new file mode 100644 (file)
index 0000000..8c67954
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+#set -x
+set -e
+
+echo "\n\n\n"
+echo "#########################################"
+echo "\n\n\n"
+
+
+export RSYNCDST="/srv/download/AGL/upload/ci/${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}"
+export RSYNCSRC=$(pwd)/UPLOAD/
+
+# construct upload folder
+mv UPLOAD UPLOAD2 || true
+rm -rf UPLOAD2 || true
+mkdir -p UPLOAD/${MACHINE}
+export DEST=$(pwd)/UPLOAD/${MACHINE}
+
+
+cd $REPODIR
+
+cd output
+
+pwd
+ls -alhR tmp/deploy/images
+
+
+# copy files to $DEST
+for i in DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT; do
+    eval cp -avL tmp/deploy/images/${MACHINE}/$(echo "$"${i}) ${DEST}/
+done
+
+tree $DEST
+ls -alhR $DEST
+
+ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 mkdir -p ${RSYNCDST}
+
+rsync -avr -L -e "ssh -o StrictHostKeyChecking=no" $RSYNCSRC jenkins-slave@10.30.72.8:$RSYNCDST
diff --git a/jjb/common/include-agl-run-test-short.sh b/jjb/common/include-agl-run-test-short.sh
new file mode 100644 (file)
index 0000000..0e38272
--- /dev/null
@@ -0,0 +1,128 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Run SHORT CI test
+################################################################################
+
+
+set -x
+
+echo "## ${MACHINE} ##"
+cd $REPODIR
+
+echo "default keyring config"
+mkdir -p ~/.local/share/python_keyring/
+cat <<EOF >  ~/.local/share/python_keyring/keyringrc.cfg
+[backend]
+default-keyring=keyring.backends.file.PlaintextKeyring
+EOF
+
+cat <<EOF > ~/.local/token
+$AGLLAVATOKEN
+EOF
+
+lava-tool auth-add --token-file ~/.local/token https://agl-jenkins-user@porter.automotivelinux.org
+rm ~/.local/token
+
+echo "## $TESTJOBFILE ##"
+
+if [ -n $TESTJOBFILE -a -e $TESTJOBFILE ] ; then
+   cp $TESTJOBFILE testjob.yaml
+else
+echo "!! NO TESTJOBFILE - trying to continue with a default !!"
+fi
+
+cat <<EOF > testjob.yaml
+# Your first LAVA JOB definition for a $MACHINE board
+device_type: @REPLACE_DEVICE_TYPE@
+job_name: AGL-short-smoke
+
+protocols:
+  lava-xnbd:
+    port: auto
+
+timeouts:
+  job:
+    minutes: 30
+  action:
+    minutes: 15
+  connection:
+    minutes: 5
+priority: medium
+visibility: public
+
+# ACTION_BLOCK
+actions:
+- deploy:
+    timeout:
+      minutes: 10
+    to: nbd
+    dtb:
+      url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@'
+    kernel:
+      url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@'
+    initramfs:
+      url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@'
+      allow_modify: false
+    nbdroot:
+      url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@'
+      compression: @REPLACE_NBDROOT_COMPRESSION@
+    os: debian
+    failure_retry: 2
+
+# BOOT_BLOCK
+- boot:
+    method: @REPLACE_BOOT_METHOD@
+    commands: nbd
+    type: @REPLACE_BOOT_TYPE@
+    prompts: ["root@@REPLACE_MACHINE@:~"]
+    auto_login:
+      login_prompt: "login:"
+      username: root
+
+EOF
+
+CHID=${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}/${MACHINE}
+# REPLACE_DEVICE_TYPE
+sed -i -e "s#@REPLACE_DEVICE_TYPE@#${DEVICE_TYPE}#g" testjob.yaml
+sed -i -e "s#@REPLACE_DTB@#${CHID}/${DEVICE_DTB}#g" testjob.yaml
+sed -i -e "s#@REPLACE_KERNEL@#${CHID}/${DEVICE_KERNEL}#g" testjob.yaml
+sed -i -e "s#@REPLACE_INITRAMFS@#${CHID}/${DEVICE_INITRAMFS}#g" testjob.yaml
+sed -i -e "s#@REPLACE_NBDROOT@#${CHID}/${DEVICE_NBDROOT}#g" testjob.yaml
+sed -i -e "s#@REPLACE_NBDROOT_COMPRESSION@#${DEVICE_NBDROOT_COMPRESSION}#g" testjob.yaml
+sed -i -e "s#@REPLACE_BOOT_METHOD@#${DEVICE_BOOT_METHOD}#g" testjob.yaml
+sed -i -e "s#@REPLACE_BOOT_TYPE@#${DEVICE_BOOT_TYPE}#g" testjob.yaml
+sed -i -e "s#@REPLACE_MACHINE@#${DEVICE_NAME}#g" testjob.yaml
+sed -i -e "s#@REPLACE_URL_PREFIX@#${DEVICE_URL_PREFIX}#g" testjob.yaml
+
+cat testjob.yaml
+
+lava-tool submit-job --block https://agl-jenkins-user@porter.automotivelinux.org testjob.yaml | tee .myjob
+
+MYJOB=`cat .myjob | grep "submitted as job" | sed -e "s#submitted as job id: ##g"`
+
+echo "#### JOBID: $MYJOB #####"
+
+( lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB | tee .status ) || true
+STATUS=`grep "Job Status:" .status | sed -e "s#Job Status: ##g"`
+
+if [ x"Complete" = x"$STATUS"  ] ; then
+    echo "YAY! $STATUS"
+    curl -o plain_output.yaml https://porter.automotivelinux.org/scheduler/job/$MYJOB/log_file/plain
+    cat plain_output.yaml | grep '"target",' | sed -e 's#- {"dt".*"lvl".*"msg":."##g' -e 's#"}$##g'
+
+    # cleanup
+    #ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 rm -rf /srv/download/AGL/upload/ci/${CHID}/
+
+    exit 0
+else
+    echo "Nooooooooo! $STATUS"
+    curl -o plain_output.yaml https://porter.automotivelinux.org/scheduler/job/$MYJOB/log_file/plain
+    cat plain_output.yaml | grep '"target",' | sed -e 's#- {"dt".*"lvl".*"msg":."##g' -e 's#"}$##g'
+
+    # cleanup
+    #ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 rm -rf /srv/download/AGL/upload/ci/${CHID}/
+
+    exit 1
+fi
diff --git a/jjb/common/include-agl-run-test-snapshot.sh b/jjb/common/include-agl-run-test-snapshot.sh
deleted file mode 100644 (file)
index b753708..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
-# License GPLv2
-
-################################################################################
-## Run SHORT CI test
-################################################################################
-
-# test currently only for porter, rest WIP
-echo "## ${MACHINE} ##"
-
-
-echo "default keyring config"
-
-mkdir -p ~/.local/share/python_keyring/
-
-cat <<EOF >  ~/.local/share/python_keyring/keyringrc.cfg
-[backend]
-default-keyring=keyring.backends.file.PlaintextKeyring
-EOF
-
-cat <<EOF > ~/.local/token
-$AGLLAVATOKEN
-EOF
-
-lava-tool auth-add --token-file ~/.local/token https://agl-jenkins-user@porter.automotivelinux.org
-
-cat ~/.local/token
-
-cat <<EOF > testjob.yaml
-# Your first LAVA JOB definition for a porter board
-device_type: renesas-porter-uboot
-job_name: renesas-porter-uboot
-
-protocols:
-  lava-xnbd:
-    port: auto
-
-timeouts:
-  job:
-    minutes: 15
-  action:
-    minutes: 5
-  connection:
-    minutes: 2
-priority: medium
-visibility: public
-
-# ACTION_BLOCK
-actions:
-- deploy:
-    to: nbd
-    dtb:
-      url: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/uImage-r8a7791-porter.dtb'
-    kernel:
-      url: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/uImage'
-    initramfs:
-      url: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/initramfs-netboot-image-porter.ext4.gz.u-boot'
-      allow_modify: false
-    nbdroot:
-      url: 'https://download.automotivelinux.org/AGL/snapshots/master/latest/porter-nogfx/deploy/images/porter/core-image-minimal-porter.ext4'
-    os: debian
-    failure_retry: 2
-
-
-# BOOT_BLOCK
-- boot:
-    method: u-boot
-    commands: nbd
-    type: bootm
-    prompts: ["root@porter:~"]
-    auto_login:
-      login_prompt: "login:"
-      username: root
-
-EOF
-
-#rm ~/.local/token
-
-lava-tool submit-job https://agl-jenkins-user@porter.automotivelinux.org testjob.yaml | tee .myjob
-
-MYJOB=`cat .myjob | sed -e "s#submitted as job id: ##g"`
-
-echo $MYJOB
-
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-lava-tool job-details https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-lava-tool job-output https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-sleep 10
-lava-tool job-details https://agl-jenkins-user@porter.automotivelinux.org $MYJOB
-
-
-
-# setup 
\ No newline at end of file
index ec905b9..990da1b 100644 (file)
@@ -83,7 +83,7 @@
           trigger-on:
             - patchset-created-event:
                 exclude-drafts: 'false'
-                exclude-trivial-rebase: 'true'
+                exclude-trivial-rebase: 'false'
                 exclude-no-code-change: 'true'
             - draft-published-event
             - comment-added-contains-event:
           trigger-on:
             - patchset-created-event:
                 exclude-drafts: 'false'
-                exclude-trivial-rebase: 'true'
+                exclude-trivial-rebase: 'false'
                 exclude-no-code-change: 'true'
             - draft-published-event
             - comment-added-contains-event:
                   branch-pattern: '**/{branch}'
           silent: 'true'
 
+- trigger:
+    name: gerrit-trigger-patch-submitted-silent-start
+    triggers:
+      - gerrit:
+          server-name: 'gerrit.automotivelinux.org'
+          trigger-on:
+            - patchset-created-event:
+                exclude-drafts: 'false'
+                exclude-trivial-rebase: 'false'
+                exclude-no-code-change: 'true'
+            - draft-published-event
+            - comment-added-contains-event:
+                comment-contains-value: 'recheck'
+            - comment-added-contains-event:
+                comment-contains-value: 'rebuild'
+            - comment-added-contains-event:
+                comment-contains-value: 'reverify'
+            - comment-added-contains-event:
+                comment-contains-value: 'RECHECK'
+            - comment-added-contains-event:
+                comment-contains-value: 'REBUILD'
+            - comment-added-contains-event:
+                comment-contains-value: 'REVERIFY'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{name}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+          silent-start: 'true'
+
+
 - trigger:
     name: gerrit-trigger-patch-merged
     triggers:
             - '2d097b8f-bc4a-4222-b496-4ac6332015d7'
       - ansicolor
       - openstack:
-          single-use: True
+          single-use: true
deleted file mode 120000 (symlink)
index 2f40c0603d5ec35572802e4f081820553c4526b7..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../common/include-agl-build.sh
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..25873455fabbee001ca54dd3b8c4735f6652cd61
--- /dev/null
@@ -0,0 +1,221 @@
+#!/bin/bash
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+#
+# debugging purposes
+set -e
+
+# VARIABLES
+OPTIND=1
+export DLHOST="https://download-new.automotivelinux.org/"
+export NOGFX=false
+export VERBOSE=false
+export DEBUG=false
+function vprint() {
+    :
+}
+function dprint() {
+    :
+}
+
+# defaults for project, branch, refspec
+export TARGETPROJECT="AGL/AGL-repo"
+export TARGETBRANCH="master"
+export TARGETREFSPEC="refs/heads/master"
+
+export TARGETFEATURESnogfx="agl-appfw-smack agl-netboot agl-sota agl-devel"
+export TARGETFEATURES="agl-demo ${TARGETFEATURESnogfx}"
+
+export TARGETQA=""
+export TARGETIMAGE="agl-demo-platform\${TARGETQA}"
+export TARGETIMAGEnogfx="core-image-minimal"
+
+export TARGETRELEASEVERSION=""
+export TARGETRELEASEBRANCH=""
+
+# apply GERRIT_*
+if test -n "${GERRIT_PROJECT}"; then
+export TARGETPROJECT="${GERRIT_PROJECT}"
+fi
+if test -n "${GERRIT_BRANCH}"; then
+    export TARGETBRANCH="${GERRIT_BRANCH}"
+fi
+if test -n "${GERRIT_REFSPEC}"; then
+export TARGETREFSPEC="${GERRIT_REFSPEC}"
+fi
+
+if test -n "${RELEASE_VERSION}"; then
+export TARGETRELEASEVERSION="${RELEASE_VERSION}"
+fi
+
+if test -n "${RELEASE_BRANCH}"; then
+export TARGETRELEASEBRANCH="${RELEASE_BRANCH}"
+export TARGETBRANCH="${RELEASE_BRANCH}"
+export TARGETREFSPEC="refs/heads/${RELEASE_BRANCH}"
+fi
+
+if test x"" = x"${MACHINE}"; then
+    export MACHINE="qemux86-64"
+fi
+
+# finally cmdline arguments
+while getopts ":b:i:p:r:dnqvx" opt; do
+    case "$opt" in
+       b)
+           export TARGETBRANCH="$OPTARG"
+           ;;
+       d)
+           DEBUG=true
+           function dprint() {
+               echo "DEBUG: $@"
+           }
+           ;;
+       i)
+           export TARGETIMAGE="$OPTARG"
+           ;;
+       n)
+           export NOGFX=true
+           ;;
+       p)
+           export TARGETPROJECT="$OPTARG"
+           ;;
+       q)
+           export TARGETQA="-qa"
+           ;;
+       r)
+           export TARGETREFSPEC="$OPTARG"
+           ;;
+       v)
+           VERBOSE=true
+           function vprint() {
+               echo "VERBOSE: \"$@\""
+           }
+           ;;
+       x)
+           set -x
+           ;;
+       h|\?)
+           echo "$0 [-h/-?] -bdinpqrvx"
+           echo "--------------------------------------------------------------------------------"
+           echo "  -b <branch>  - name of the branch to use          (default=master)"
+           echo "  -d           - debug"
+           echo "  -i <image>   - name of the image to build         (default=agl-demo-platform)"
+           echo "  -n           - no graphics (no wayland, aka no drivers)"
+           echo "  -p <project> - project to use                     (default=AGL/AGL-repo)"
+           echo "  -q           - build '*-qa' images                (default='')"
+           echo "  -r <refspec> - refspec to use                     (default=refs/heads/master)"
+           echo "  -v           - verbose"
+           echo "  -x           - set -x"
+           echo "--------------------------------------------------------------------------------"
+           echo "  GERRIT_PROJECT, GERRIT_BRANCH, GERRIT_REFSPEC are used if present,"
+           echo "  but cmdline arguments take precedence."
+           echo "--------------------------------------------------------------------------------"
+           exit 1
+           ;;
+       :)
+           echo "Option -$OPTARG required an argument."
+           exit 1
+           ;;
+    esac
+done
+
+# expand
+eval TARGETIMAGE="$TARGETIMAGE"
+eval TARGETIMAGEnogfx="$TARGETIMAGEnogfx"
+
+if $NOGFX; then
+    export TARGETIMAGE="${TARGETIMAGEnogfx}"
+    export TARGETFEATURES="${TARGETFEATURESnogfx}"
+fi
+if test x"porter-nogfx" = x"$MACHINE"; then
+    export TARGETIMAGE="${TARGETIMAGEnogfx}"
+    export TARGETFEATURES="${TARGETFEATURESnogfx}"
+fi
+
+if test ! x"" = x"$TARGETRELEASEVERSION"; then
+MANIFESTMOD="-m ${TARGETRELEASEBRANCH}_${TARGETRELEASEVERSION}.xml"
+else
+MANIFESTMOD=""
+fi
+
+if $DEBUG; then
+set | grep ^TARGET || true
+set | grep ^GERRIT || true
+set | grep ^MACHINE || true
+fi
+
+
+# create shared downloads and sstate-cache directory
+mkdir -p downloads
+mkdir -p sstate-cache
+
+# remove old files, we want to test a fresh clone
+export XTMP="$$"
+mv repoclone repoclone$XTMP || true
+( rm -rf repoclone$XTMP & ) || true
+mkdir -p repoclone
+cd repoclone
+
+repo init --reference=/opt/AGL/preclone -q -b $TARGETBRANCH $MANIFESTMOD -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
+
+# next: repo sync and dump manifest
+repo sync --force-sync --detach --no-clone-bundle
+
+# fix up this branch
+MYPROJECT=`echo $TARGETPROJECT | sed -e "s#AGL/##g"`
+
+
+if test -n "${GERRIT_CHANGE_NUMBER}" -a -n "${GERRIT_PATCHSET_NUMBER}"  ; then
+    repo download $MYPROJECT ${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}
+else
+    if test x"AGL-repo" = x"$MYPROJECT" ; then
+       cd .repo/manifests
+        MYREMOTE=`git remote | head -1`
+        git fetch ${MYREMOTE} ${TARGETREFSPEC}
+        git reset --hard FETCH_HEAD
+       cd ../../
+       repo sync --force-sync -d
+    else
+       cd $MYPROJECT
+       MYREMOTE=`git remote | head -1`
+       git fetch ${MYREMOTE} ${TARGETREFSPEC}
+       git reset --hard FETCH_HEAD
+       cd ..
+    fi
+fi
+
+repo manifest -r
+repo manifest -r > ../current_default.xml
+
+# source the env
+source meta-agl/scripts/aglsetup.sh -m ${MACHINE} -b output ${TARGETFEATURES}
+
+# link the shared downloads and sstate-cache
+ln -sf ../../downloads
+ln -sf ../../sstate-cache
+
+echo "" >> conf/local.conf
+
+#limit parallel number of bitbake jobs and parallel jobs in make
+cat << EOF > conf/auto.conf
+PREMIRRORS = "\
+git://.*/.* ${DLHOST}/AGL/mirror/   \n \
+ftp://.*/.* ${DLHOST}/AGL/mirror/   \n \
+http://.*/.* ${DLHOST}/AGL/mirror/  \n \
+https://.*/.* ${DLHOST}/AGL/mirror/ \n \
+             "
+
+SSTATE_MIRRORS = "\
+file://.* file:///opt/AGL/sstate-mirror/\${MACHINE}/PATH    \n \
+file://.* ${DLHOST}/sstate-mirror/\${MACHINE}/PATH \n \
+                 "
+
+SSTATE_DIR = "\${TOPDIR}/sstate-cache/\${MACHINE}/"
+EOF
+
+cat conf/auto.conf
+
+# finally, build the agl-demo-platform
+bitbake $TARGETIMAGE
+
+du -hs tmp/deploy/*
diff --git a/jjb/sandbox-ci-jjb/sandbox-ci-jjb.yaml b/jjb/sandbox-ci-jjb/sandbox-ci-jjb.yaml
new file mode 100644 (file)
index 0000000..1fac29c
--- /dev/null
@@ -0,0 +1,329 @@
+- project:
+    name: sandbox-ci
+    machine:
+        - porter-nogfx
+        - raspberrypi3
+        - intel-corei7-64
+        - dra7xx-evm
+        - qemux86-64
+    project:
+        - meta-agl
+        - meta-agl-demo
+        - meta-agl-devel
+        - meta-agl-extra
+        - AGL-repo
+        - meta-renesas
+    jobs:
+        - sandbox-{project}-verify
+        - sandbox-{project}-verify-CIB-{machine}
+        - sandbox-{project}-verify-CIB-finish
+        - sandbox-{project}-verify-CIBT-{machine}
+        - sandbox-{project}-verify-CIBT-finish
+
+#
+# -verify  = trigger from gerrit and control job
+################################################
+
+- job-template:
+    name: 'sandbox-{project}-verify'
+    project-type: multijob
+    concurrent: true
+    node: control-slave
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'AGL/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/master
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "patchset # to build"
+
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    triggers:
+      - gerrit-trigger-patch-submitted-silent:
+            name: 'AGL/{project}'
+            branch: '**/**/**'
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    builders:
+      - multijob:
+          name: CIB-{project}
+          condition: COMPLETED
+          projects:
+            - name: 'sandbox-{project}-verify-CIB-porter-nogfx'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIB-intel-corei7-64'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIB-raspberrypi3'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIB-dra7xx-evm'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIB-qemux86-64'
+              current-parameters: true
+      - multijob:
+          name: CIB-{project}-finish
+          condition: COMPLETED
+          projects:
+            - name: 'sandbox-{project}-verify-CIB-finish'
+              current-parameters: true
+      - multijob:
+          name: CIBT-{project}
+          condition: COMPLETED
+          projects:
+            - name: 'sandbox-{project}-verify-CIBT-porter-nogfx'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIBT-intel-corei7-64'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIBT-raspberrypi3'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIBT-dra7xx-evm'
+              current-parameters: true
+            - name: 'sandbox-{project}-verify-CIBT-qemux86-64'
+              current-parameters: true
+      - multijob:
+          name: 'CIBT-{project}-finish'
+          condition: COMPLETED
+          projects:
+            - name: 'sandbox-{project}-verify-CIBT-finish'
+              current-parameters: true
+
+#    publishers:
+
+
+#
+# CIB-{machine}
+###############
+
+- job-template:
+    name: 'sandbox-{project}-verify-CIB-{machine}'
+    project-type: freestyle
+    concurrent: true
+    node: agl-test-slave
+
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'AGL/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/master
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "patchset # to build"
+      - string:
+          name: MACHINE
+          default: '{machine}'
+          description: "Machine to build"
+
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+      - openstack:
+          single-use: true
+
+    builders:
+      - shell:
+            !include-raw-escape:
+                - ../common/include-agl-header.sh
+                - ../common/include-agl-repo.sh
+                - ../common/include-agl-select.sh
+                - ../common/include-agl-source-aglsetup.sh
+                - ../common/include-agl-auto-conf.sh
+                - ../common/include-agl-limit-parallelism.sh
+                - ../common/include-agl-cat-auto-conf.sh
+                - ../common/include-agl-bitbake-image.sh
+                - ../common/include-agl-run-test-prepare.sh
+                - ../common/include-agl-run-test-rsync-changeid.sh
+
+#
+# CIB-finish
+############
+
+- job-template:
+    name: 'sandbox-{project}-verify-CIB-finish'
+    project-type: freestyle
+    concurrent: true
+    node: control-slave
+
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'AGL/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/master
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "patchset # to build"
+
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+      - openstack:
+          single-use: true
+
+    builders:
+      - shell: "echo YAY"
+#; ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${GERRIT_CHANGE_NUMBER},${GERRIT_PATCHSET_NUMBER} --label=ci-image-build=+1 -n NONE --message='CI-Image-Build '"
+
+
+#
+# CIBT-{machine} 'BOOT TEST'
+############################
+
+- job-template:
+    name: 'sandbox-{project}-verify-CIBT-{machine}'
+    project-type: freestyle
+    concurrent: true
+    node: agl-test-slave
+
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'AGL/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/master
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "patchset # to build"
+      - string:
+          name: MACHINE
+          default: '{machine}'
+          description: "Machine to build"
+
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+      - openstack:
+          single-use: true
+      - credentials-binding:
+          - username-password-separated:
+              credential-id: agl_main_lava_instance
+              username: AGLLAVAUSER
+              password: AGLLAVATOKEN
+
+    builders:
+      - shell:
+            !include-raw-escape:
+                - ../common/include-agl-header.sh
+                - ../common/include-agl-repo.sh
+                - ../common/include-agl-select.sh
+                - ../common/include-agl-run-test-prepare.sh
+                - ../common/include-agl-run-test-short.sh
+
+
+#
+# CIBT-finish
+################
+
+- job-template:
+    name: 'sandbox-{project}-verify-CIBT-finish'
+    project-type: freestyle
+    concurrent: true
+    node: control-slave
+
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'AGL/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: master
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/master
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "patchset # to build"
+
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+      - openstack:
+          single-use: true
+
+    builders:
+      - shell: "echo YAY"
+#; ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${GERRIT_CHANGE_NUMBER},${GERRIT_PATCHSET_NUMBER} --label=ci-image-build=+1 -n NONE --message='CI-Image-Build '"
index c83d5ff..e30a896 100644 (file)
@@ -12,7 +12,7 @@
     parameters:
       - string:
           name: GERRIT_PROJECT
-          default: AGL/AGL-repo
+          default: AGL/meta-agl
           description: "Project to build"
       - string:
           name: GERRIT_BRANCH
           name: GERRIT_REFSPEC
           default: refs/heads/master
           description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "8313"
+          description: "refspec to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: "2"
+          description: "refspec to build"
     axes:
       - axis:
           type: user-defined
@@ -36,7 +44,7 @@
 
     build-discarder:
       days-to-keep: 30
-      num-to-keep: 40
+      num-to-keep: 2
       artifact-days-to-keep: -1
       artifact-num-to-keep: 5
 
               credential-id: agl_main_lava_instance
               username: AGLLAVAUSER
               password: AGLLAVATOKEN
+      - openstack:
+          single-use: False
 
     builders:
       - shell:
             !include-raw-escape:
-                - ../common/include-agl-run-test-snapshot.sh
+                - ../common/include-agl-header.sh
+                - ../common/include-agl-repo.sh
+                - ../common/include-agl-select.sh
+                - ../common/include-agl-source-aglsetup.sh
+                - ../common/include-agl-auto-conf.sh
+                - ../common/include-agl-limit-parallelism.sh
+                - ../common/include-agl-cat-auto-conf.sh
+                - ../common/include-agl-bitbake-image.sh
+                - ../common/include-agl-run-test-prepare.sh
+                - ../common/include-agl-run-test-rsync-changeid.sh
+                - ../common/include-agl-run-test-short.sh