Add generic jjb CI job for AGL 59/7059/3
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Mon, 7 Nov 2016 11:37:23 +0000 (12:37 +0100)
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>
Mon, 7 Nov 2016 11:49:16 +0000 (12:49 +0100)
Change-Id: I8264fd08a6ea2348751c1c7ed15da1103fbf4272
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
14 files changed:
jjb/ci-jjb-AGL/ci-jjb-AGL.yaml [new file with mode: 0644]
jjb/common/include-agl-auto-conf.sh [new file with mode: 0644]
jjb/common/include-agl-bitbake-image.sh [new file with mode: 0644]
jjb/common/include-agl-bitbake-sdk.sh [new file with mode: 0644]
jjb/common/include-agl-build.sh [changed mode: 0755->0644]
jjb/common/include-agl-header.sh [new file with mode: 0644]
jjb/common/include-agl-local-conf-archiver.sh [new file with mode: 0644]
jjb/common/include-agl-local-conf-isafw.sh [new file with mode: 0644]
jjb/common/include-agl-local-conf-vmdk.sh [new file with mode: 0644]
jjb/common/include-agl-repo.sh [new file with mode: 0644]
jjb/common/include-agl-select.sh [new file with mode: 0644]
jjb/common/include-agl-source-aglsetup.sh [new file with mode: 0644]
jjb/common/include-agl-test-nbd-short.sh [new file with mode: 0644]
jjb/global-macros.yaml

diff --git a/jjb/ci-jjb-AGL/ci-jjb-AGL.yaml b/jjb/ci-jjb-AGL/ci-jjb-AGL.yaml
new file mode 100644 (file)
index 0000000..2ca384a
--- /dev/null
@@ -0,0 +1,70 @@
+- project:
+    name: ci-jjb-AGL
+    jobs:
+        - ci-jjb-AGL
+
+- job-template:
+    name: 'ci-jjb-AGL'
+    project-type: matrix
+    concurrent: true
+    node: master
+    disabled: true
+
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: AGL/AGL-repo
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: blowfish
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/blowfish
+          description: "refspec to build"
+
+    axes:
+      - axis:
+          type: user-defined
+          name: MACHINE
+          values:
+            - qemux86
+            - porter-nogfx
+            - intel-corei7-64
+      - axis:
+          type: slave
+          name: label
+          values:
+            - agl-test-slave
+
+    build-discarder:
+      days-to-keep: 30
+      num-to-keep: 40
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+
+    scm:
+      - gerrit-trigger-scm:
+          refspec: ''
+          choosing-strategy: 'default'
+
+    triggers:
+      - gerrit-trigger-patch-merged:
+            name: 'AGL/**'
+            branch: '**'
+
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    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-bitbake-image.sh
+                - ../common/include-agl-test-nbd-short.sh
diff --git a/jjb/common/include-agl-auto-conf.sh b/jjb/common/include-agl-auto-conf.sh
new file mode 100644 (file)
index 0000000..22fce7d
--- /dev/null
@@ -0,0 +1,25 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+#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
diff --git a/jjb/common/include-agl-bitbake-image.sh b/jjb/common/include-agl-bitbake-image.sh
new file mode 100644 (file)
index 0000000..180cef7
--- /dev/null
@@ -0,0 +1,11 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# finally, build the agl-demo-platform (we retry to catch the tar-native bug)
+bitbake $TARGETIMAGE || bitbake $TARGETIMAGE
+
+du -hs tmp/deploy/*
diff --git a/jjb/common/include-agl-bitbake-sdk.sh b/jjb/common/include-agl-bitbake-sdk.sh
new file mode 100644 (file)
index 0000000..4627932
--- /dev/null
@@ -0,0 +1,11 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# finally, build the agl-demo-platform (we retry to catch the tar-native bug)
+bitbake -c $TARGETSDK $TARGETIMAGE || bitbake -c $TARGETSDK $TARGETIMAGE
+
+du -hs tmp/deploy/*
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/jjb/common/include-agl-header.sh b/jjb/common/include-agl-header.sh
new file mode 100644 (file)
index 0000000..62dd644
--- /dev/null
@@ -0,0 +1,132 @@
+#!/bin/bash
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+#
+# debugging purposes
+set -e
+
+################################################################################
+## HEADER
+################################################################################
+
+
+# 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="agl-image-ivi\${TARGETQA}"
+
+export TARGETSDK="populate_sdk"
+
+# 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 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}
+fi
+if test x"porter-nogfx" = x"$MACHINE"; then
+    export TARGETIMAGE=${TARGETIMAGEnogfx}
+fi
+
+#if $DEBUG; then
+set | grep ^TARGET || true
+set | grep ^GERRIT || true
+set | grep ^MACHINE || true
+#fi
+
diff --git a/jjb/common/include-agl-local-conf-archiver.sh b/jjb/common/include-agl-local-conf-archiver.sh
new file mode 100644 (file)
index 0000000..f9478ee
--- /dev/null
@@ -0,0 +1,10 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# archive sources within  tmp/deploy/
+echo 'INHERIT += "archiver"' >> conf/local.conf
+echo 'ARCHIVER_MODE[src] = "original"' >> conf/local.conf
diff --git a/jjb/common/include-agl-local-conf-isafw.sh b/jjb/common/include-agl-local-conf-isafw.sh
new file mode 100644 (file)
index 0000000..dea4f2f
--- /dev/null
@@ -0,0 +1,10 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# meta-security-isafw
+echo "BBLAYERS += \" $(pwd)/../meta-security-isafw \" " >> conf/bblayers.conf
+echo "INHERIT += \"isafw\" " >> conf/local.conf
diff --git a/jjb/common/include-agl-local-conf-vmdk.sh b/jjb/common/include-agl-local-conf-vmdk.sh
new file mode 100644 (file)
index 0000000..bd582e9
--- /dev/null
@@ -0,0 +1,10 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+if test x"qemux86" == x"$MACHINE" -o x"qemux86-64" == x"$MACHINE" ; then
+ echo 'IMAGE_FSTYPES += "vmdk"' >> conf/local.conf
+fi
diff --git a/jjb/common/include-agl-repo.sh b/jjb/common/include-agl-repo.sh
new file mode 100644 (file)
index 0000000..f95e320
--- /dev/null
@@ -0,0 +1,23 @@
+# (c) 2016 Jan-Simon Moeller, dl9pf(at)gmx.de
+# License: GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# 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 -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
+
+# next: repo sync and dump manifest
+repo sync --force-sync --detach --no-clone-bundle
+
diff --git a/jjb/common/include-agl-select.sh b/jjb/common/include-agl-select.sh
new file mode 100644 (file)
index 0000000..b46c4ea
--- /dev/null
@@ -0,0 +1,87 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+HANDLED=false
+
+# Projects in AGL/*
+###################
+if test !$HANDLED -a $(echo "$TARGETPROJECT" | grep -q "^AGL/"); then
+
+    MYPROJECT=`echo $TARGETPROJECT | sed -e "s#AGL/##g"`
+
+    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
+        if test -n "${GERRIT_CHANGE_NUMBER}" -a -n "${GERRIT_PATCHSET_NUMBER}"  ; then
+            repo download $MYPROJECT ${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}
+        else
+            cd $MYPROJECT
+            MYREMOTE=`git remote | head -1`
+            git fetch ${MYREMOTE} ${TARGETREFSPEC}
+            git reset --hard FETCH_HEAD
+            cd ..
+        fi
+    fi
+    HANDLED=true
+fi
+
+
+# Projects in src/*
+###################
+if test !$HANDLED -a $(echo "$TARGETPROJECT" | grep -q "^src/"); then
+
+MYPROJECT=`echo $TARGETPROJECT | sed -e "s#src/##g"`
+
+# We need to set the refspec in the recipe. 
+# Therefore each src/* must have a .aglrecipe file with the location
+# relative to a repo clone
+# e.g. ./meta-agl/meta-agl/recipes-graphics/wayland/foo.bb
+#
+# Also there must be a SRCREV tag which we can manipulate.
+#
+#
+echo "Not implemented"
+exit 0
+
+fi
+
+
+# Projects in staging/*
+#######################
+if test !$HANDLED -a $(echo "$TARGETPROJECT" | grep -q "^staging/"); then
+
+MYPROJECT=`echo $TARGETPROJECT | sed -e "s#staging/##g"`
+
+# We need to set the refspec in the recipe. 
+# Therefore each src/* must have a .aglrecipe file with the location
+# relative to a repo clone
+# e.g. ./meta-agl/meta-agl/recipes-graphics/wayland/foo.bb
+#
+# Also there must be a SRCREV tag which we can manipulate.
+#
+#
+echo "Not implemented"
+exit 0
+
+
+fi
+
+if !$HANDLED; then
+    echo "COULD NOT SELECT PROJECT, something is wrong!"
+    echo "$TARGETPROJECT"
+    echo ""
+    set
+    exit 1
+fi
+
+repo manifest -r
+repo manifest -r > ../current_default.xml
diff --git a/jjb/common/include-agl-source-aglsetup.sh b/jjb/common/include-agl-source-aglsetup.sh
new file mode 100644 (file)
index 0000000..f66d83f
--- /dev/null
@@ -0,0 +1,17 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# 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
+echo "### ADDED BY AUTOBUILDER ###" >> conf/local.conf
+echo "" >> conf/local.conf
diff --git a/jjb/common/include-agl-test-nbd-short.sh b/jjb/common/include-agl-test-nbd-short.sh
new file mode 100644 (file)
index 0000000..dcaa65c
--- /dev/null
@@ -0,0 +1,29 @@
+# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
+# License GPLv2
+
+################################################################################
+## Main
+################################################################################
+
+# test currently only for porter, rest WIP
+TESTRUN=false
+echo "## $MACHINE ##"
+
+case $MACHINE in
+    porter-nogfx)
+        TESTRUN=true
+        ;;
+    porter)
+        TESTRUN=true
+        ;;
+    *)
+        TESTRUN=false
+        ;;
+esac
+
+
+if $TESTRUN; then
+
+echo "TBD"
+
+fi
\ No newline at end of file
index ad4a42d..e5eadd9 100644 (file)
           trigger-on:
             - patchset-created-event:
                 exclude-drafts: 'false'
-                exclude-trivial-rebase: 'false'
-                exclude-no-code-change: 'false'
+                exclude-trivial-rebase: 'true'
+                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-compare-type: 'PLAIN'
               project-pattern: '{name}'
               branches:
-                - branch-compare-type: 'ANT'
+                - branch-compare-type: 'PLAIN'
                   branch-pattern: '**/{branch}'
 
 - trigger:
             - comment-added-contains-event:
                 comment-contains-value: 'remerge'
           projects:
-            - project-compare-type: 'ANT'
+            - project-compare-type: 'PLAIN'
               project-pattern: '{name}'
               branches:
-                - branch-compare-type: 'ANT'
+                - branch-compare-type: 'PLAIN'
                   branch-pattern: '**/{branch}'
 
 - trigger:
             - comment-added-contains-event:
                 comment-contains-value: 'reverify'
           projects:
-            - project-compare-type: 'ANT'
+            - project-compare-type: 'PLAIN'
               project-pattern: '{name}'
               branches:
-                - branch-compare-type: 'ANT'
+                - branch-compare-type: 'PLAIN'
                   branch-pattern: '**/{branch}'
           silent-start: 'true'
 
             - comment-added-contains-event:
                 comment-contains-value: 'fullcheck'
           projects:
-            - project-compare-type: 'ANT'
+            - project-compare-type: 'PLAIN'
               project-pattern: '{name}'
               branches:
-                - branch-compare-type: 'ANT'
+                - branch-compare-type: 'PLAIN'
                   branch-pattern: '**/{branch}'
           silent-start: 'true'
 
             - comment-added-contains-event:
                 comment-contains-value: 'remerge'
           projects:
-            - project-compare-type: 'Plain'
+            - project-compare-type: 'PLAIN'
               project-pattern: '{name}'
               branches:
-                - branch-compare-type: 'Path'
+                - branch-compare-type: 'PLAIN'
                   branch-pattern: '**/{branch}'
           silent-start: 'true'
 
           trigger-on:
             - ref-updated-event
           projects:
-            - project-compare-type: 'Plain'
+            - project-compare-type: 'PLAIN'
               project-pattern: '{name}'
               branches:
-                - branch-compare-type: 'Path'
+                - branch-compare-type: 'PLAIN'
                   branch-pattern: 'refs/tags/**'
 
 # Publishers