After merge, rebuild app 61/11061/1
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Thu, 28 Sep 2017 11:59:36 +0000 (13:59 +0200)
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>
Thu, 28 Sep 2017 11:59:36 +0000 (13:59 +0200)
and upload it to the app repository folder on
the download server for consumption.

Change-Id: I3df70f0ce11f0d448999e9b54e637a53070e0439
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
jjb/ci-apps-verify/ci-apps-jjb.yaml
jjb/common/include-apps-header.sh
jjb/common/include-apps-prepare-upload-folder-merged.sh [new file with mode: 0644]
jjb/common/include-apps-rsync-download-apprepo.sh [new file with mode: 0644]

index a7a3018..bd50f50 100644 (file)
@@ -6,6 +6,7 @@
       - dab
     architecture:
       - aarch64
+        #= dragonboard-410c (disabled for dab atm)
       - x86-64
         #= intel-corei7-64
         #= qemux86-64
@@ -16,7 +17,9 @@
     project:
       - agl-service-bluetooth
       - agl-service-geoclue
+      - agl-service-geofence
       - agl-service-gps
+      - agl-service-homescreen-2017
       - agl-service-mediascanner
       - agl-service-radio
       - agl-service-steering-wheel
       - ci-apps-{project}-verify-{aglbranch}-CIB-finish-success
       - ci-apps-{project}-verify-{aglbranch}-failure
       - ci-apps-{project}-remove-{aglbranch}-artifacts
+      - ci-apps-{project}-merge-{aglbranch}
+      - ci-apps-{project}-merge-{aglbranch}-{architecture}
+      - ci-apps-{project}-merge-{aglbranch}-finish-success
+      # currently unused templates
       # - ci-apps-{project}-verify-CIB-start
       # - ci-apps-{project}-verify-CIBT-start
       #- ci-apps-{project}-verify-CIBT-{architecture}
@@ -49,6 +56,7 @@
 ################################################################################################################################################################
 ################################################################################################################################################################
 
+################# VERIFY #################
 
 ################################################################################
 # ci-apps-{project}-verify  =  trigger from gerrit and control job
 
 
 
+################################################################################################################################################################
+################################################################################################################################################################
 
+################# REMOVE #################
 
 
+#####################################################
+# -remove-artifacts = merge/abandon, remove artifacts
+#####################################################
+- job-template:
+    name: 'ci-apps-{project}-remove-{aglbranch}-artifacts'
+    project-type: freestyle
+    concurrent: true
+    node: control-slave
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'apps/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: '{aglbranch}'
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/{aglbranch}
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: "9551"
+          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: false
+    triggers:
+      - gerrit-trigger-silent-patch-merged-abandoned:
+          name: 'apps/{project}'
+          branch: 'refs/heads/{aglbranch}'
+    builders:
+      - shell:
+          !include-raw-escape:
+          - ../common/include-agl-remove-artifacts-changeid.sh
 
 
 
 
 ################################################################################################################################################################
 ################################################################################################################################################################
+
+################# MERGE #################
+
+################################################################################
+# ci-apps-{project}-merge  =  trigger from gerrit and control job
+################################################################################
+- job-template:
+    name: 'ci-apps-{project}-merge-{aglbranch}'
+    project-type: multijob
+    concurrent: true
+    node: control-slave
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'apps/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: '{aglbranch}'
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: 'refs/heads/{aglbranch}'
+          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: AGLBRANCH
+          default: '{aglbranch}'
+          description: "AGL release branch to use"
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+    triggers:
+      - gerrit-trigger-silent-patch-merged:
+          name: 'apps/{project}'
+          branch: '{aglbranch}'
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+    builders:
+      - multijob:
+          name: CI-merge-{project}
+          condition: SUCCESSFUL
+          projects:
+            - name: 'ci-apps-{project}-merge-{aglbranch}-arm'
+              current-parameters: true
+              #abort-all-job: true
+              kill-phase-on: FAILURE
+              predefined-parameters: AGLBRANCH={aglbranch}
+            - name: 'ci-apps-{project}-merge-{aglbranch}-aarch64'
+              current-parameters: true
+              #abort-all-job: true
+              kill-phase-on: FAILURE
+              predefined-parameters: AGLBRANCH={aglbranch}
+            - name: 'ci-apps-{project}-merge-{aglbranch}-x86-64'
+              current-parameters: true
+              #abort-all-job: true
+              kill-phase-on: FAILURE
+              predefined-parameters: AGLBRANCH={aglbranch}
+      - multijob:
+          name: CIB-{project}-{aglbranch}-finish-success
+          condition: SUCCESSFUL
+          projects:
+            - name: 'ci-apps-{project}-merge-{aglbranch}-CIB-finish-success'
+              current-parameters: true
+              abort-all-job: true
+              kill-phase-on: FAILURE
+
+
+################################################################################
+# ci-apps-{project}-merge-CIB-{architecture}  =  build job per arch
+################################################################################
+- job-template:
+    name: 'ci-apps-{project}-merge-{aglbranch}-{architecture}'
+    project-type: freestyle
+    concurrent: true
+    node: agl-test-slave
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'apps/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: '{aglbranch}'
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: refs/heads/{aglbranch}
+          description: "refspec to build"
+      - string:
+          name: GERRIT_CHANGE_NUMBER
+          default: ""
+          description: "change # to build"
+      - string:
+          name: GERRIT_PATCHSET_NUMBER
+          default: ""
+          description: "patchset # to build"
+      - string:
+          name: TARGETARCH
+          default: '{architecture}'
+          description: "Machine to build"
+      - string:
+          name: AGLBRANCH
+          default: '{aglbranch}'
+          description: "AGL release branch to use"
+
+    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:
+          # including from ../common into ci-apps-{project}-merge-{aglbranch}-CIB-{architecture}
+          !include-raw-escape:
+          - ../common/include-apps-header.sh
+          - ../common/include-apps-fetch-install-sdk.sh
+          - ../common/include-apps-build-app.sh
+          - ../common/include-apps-prepare-upload-folder-merged.sh
+          - ../common/include-apps-rsync-download-apprepo.sh
+
+    publishers:
+      - naginator:
+          rerun-unstable-builds: true
+          progressive-delay-increment: 5
+          progressive-delay-maximum: 15
+          max-failed-builds: 2
+          #regular-expression: "Unexpected termination of the channel"
+
+
+################################################################################
+# ci-apps-{project}-merge-finish-succcess  =  success, msg to gerrit
+################################################################################
+- job-template:
+    name: 'ci-apps-{project}-merge-{aglbranch}-finish-success'
+    project-type: freestyle
+    concurrent: true
+    node: control-slave
+    parameters:
+      - string:
+          name: GERRIT_PROJECT
+          default: 'apps/{project}'
+          description: "Project to build"
+      - string:
+          name: GERRIT_BRANCH
+          default: '{aglbranch}'
+          description: "branch to build"
+      - string:
+          name: GERRIT_REFSPEC
+          default: 'refs/heads/{aglbranch}'
+          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: AGLBRANCH
+          default: '{aglbranch}'
+          description: "AGL release branch to use"
+    build-discarder:
+      days-to-keep: 30
+      artifact-days-to-keep: -1
+      artifact-num-to-keep: 5
+    wrappers:
+      - agl-infra-wrappers:
+          build-timeout: '{build-timeout}'
+    builders:
+      - shell: |
+          ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified +1 --label ci-image-build=+1 -n NONE --message="Merge\ finished,\ Artifacts\ available\ at\ https://download.automotivelinux.org/AGL/apps/{project}/\ ." || true
+
+
+
+
+
+
+
+
+
+
+
+
+
+################################################################################################################################################################
+# ATTIC ###############################################################################################################################################################
 ################################################################################################################################################################
 ################################################################################################################################################################
 
 
 
 
-
-
-################################################################################
-################################################################################
-# -remove-artifacts = merge/abandon, remove artifacts and later trigger sstate
-################################################################################
-- job-template:
-    name: 'ci-apps-{project}-remove-{aglbranch}-artifacts'
-    project-type: freestyle
-    concurrent: true
-    node: control-slave
-    parameters:
-      - string:
-          name: GERRIT_PROJECT
-          default: 'apps/{project}'
-          description: "Project to build"
-      - string:
-          name: GERRIT_BRANCH
-          default: '{aglbranch}'
-          description: "branch to build"
-      - string:
-          name: GERRIT_REFSPEC
-          default: refs/heads/{aglbranch}
-          description: "refspec to build"
-      - string:
-          name: GERRIT_CHANGE_NUMBER
-          default: "9551"
-          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: false
-    triggers:
-      - gerrit-trigger-silent-patch-merged-abandoned:
-          name: 'apps/{project}'
-          branch: 'refs/heads/{aglbranch}'
-    builders:
-      - shell:
-          !include-raw-escape:
-          - ../common/include-agl-remove-artifacts-changeid.sh
-
index da084ed..9afcbde 100644 (file)
@@ -24,18 +24,9 @@ function dprint() {
     :
 }
 
-#export TARGETARCHALL="arm aarch64 x86-64"
-#set | grep arm
-#set | grep aarch64
-#set | grep x86-64
-
 echo "################################################################################"
 set | grep TARGETARCH
 echo "################################################################################"
-#if test x"" = x"${TARGETARCH}"; then
-#    export TARGETARCH="arm"
-#fi
-#set +x
 
 # finally cmdline arguments
 while getopts ":b:a:p:r:dvx" opt; do
diff --git a/jjb/common/include-apps-prepare-upload-folder-merged.sh b/jjb/common/include-apps-prepare-upload-folder-merged.sh
new file mode 100644 (file)
index 0000000..37b5887
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+#set -x
+set -e
+
+echo -e "\n\n\n"
+echo "#########################################"
+echo -e "\n\n\n"
+
+#failsafe
+if test x"" = x"${ALGBRANCH}" ; then
+  echo "AGLBRANCH not defined"
+  exit 1
+fi
+if test x"" = x"${MYPROJECT}"; then
+  echo "MYPROJECT not defined"
+  exit 1
+fi
+if test x"" = x"${BUILD_NUMBER}"; then
+  echo "BUILD_NUMBER not defined"
+  exit 1
+fi
+if test x"" = x"${GERRIT_CHANGE_NUMBER}"; then
+  echo "GERRIT_CHANGE_NUMBER not defined"
+  exit 1
+fi
+if test x"" = x"${TARGETARCH}"; then
+  echo "TARGETARCH is not defined"
+  exit 1
+fi
+
+# construct upload folder
+#mv UPLOAD UPLOAD2 || true
+rm -rf UPLOAD/* || true
+mkdir -p UPLOAD/${MYPROJECT}/${AGLBRANCH}/${BUILD_NUMBER}-${GERRIT_CHANGE_NUMBER}/${TARGETARCH}
+ln -sf ${BUILD_NUMBER}-${GERRIT_CHANGE_NUMBER} UPLOAD/${MYPROJECT}/${AGLBRANCH}/latest
+export DEST=$(pwd)/UPLOAD/${MYPROJECT}/${AGLBRANCH}/${BUILD_NUMBER}-${GERRIT_CHANGE_NUMBER}/${TARGETARCH}
+
+# copy the wgt to the upload folder
+pushd ${MYPROJECT}
+  pwd
+  ls -alh || true
+  ls package || true
+  cp package/*.wgt $DEST
+  ls -alh $DEST
+popd
diff --git a/jjb/common/include-apps-rsync-download-apprepo.sh b/jjb/common/include-apps-rsync-download-apprepo.sh
new file mode 100644 (file)
index 0000000..3d8e1e1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#set -x
+set -e
+
+echo -e "\n\n\n"
+echo "#########################################"
+echo -e "\n\n\n"
+#                                       project branch date(latest)
+export RSYNCDST="/srv/download/AGL/apps/"
+export RSYNCSRC=$(pwd)/UPLOAD/
+LANG=C tree $RSYNCSRC
+
+set
+
+exit 0
+ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 mkdir -p ${RSYNCDST}
+rsync -avr -l --copy-unsafe-links -e "ssh -o StrictHostKeyChecking=no" $RSYNCSRC jenkins-slave@10.30.72.8:$RSYNCDST