Build and upload app to CI folder 61/9661/1
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Thu, 8 Jun 2017 21:26:13 +0000 (23:26 +0200)
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>
Thu, 8 Jun 2017 21:26:13 +0000 (23:26 +0200)
Change-Id: Ie7947c1a8472826a4f6ee1f4ce6ccaed56945f7c
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
jjb/ci-apps-verify/ci-apps-jjb.yaml
jjb/common/include-apps-rsync-download-changeid.sh [new file with mode: 0644]

index 2536b02..137de8f 100644 (file)
       - settings-wifi
     jobs:
       - ci-apps-{project}-verify
-      # - ci-apps-{project}-verify-CIB-start
       - ci-apps-{project}-verify-CIB-{architecture}
       - ci-apps-{project}-verify-CIB-finish-success
       - ci-apps-{project}-verify-failure
+
+      # - ci-apps-{project}-verify-CIB-start
       # - ci-apps-{project}-verify-CIBT-start
       #- ci-apps-{project}-verify-CIBT-{architecture}
       #- ci-apps-{project}-verify-CIBT-finish-success
 
-#
-# -verify  = trigger from gerrit and control job
-# ###############################################
 
+################################################################################################################################################################
+################################################################################################################################################################
+
+
+################################################################################
+# ci-apps-{project}-verify  =  trigger from gerrit and control job
+################################################################################
 - job-template:
     name: 'ci-apps-{project}-verify'
     project-type: multijob
           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-manual-verified:
           name: 'apps/{project}'
           branch: '**/**/**'
           silent: 'true'
-
     wrappers:
       - agl-infra-wrappers:
           build-timeout: '{build-timeout}'
-
     builders:
       - shell: |
           set
           projects:
             - name: 'ci-apps-{project}-verify-CIB-arm'
               current-parameters: true
-              abort-all-job: true
+              #abort-all-job: true
+              kill-phase-on: FAILURE
+            - name: 'ci-apps-{project}-verify-CIB-aarch64'
+              current-parameters: true
+              #abort-all-job: true
+              kill-phase-on: FAILURE
+            - name: 'ci-apps-{project}-verify-CIB-x86-64'
+              current-parameters: true
+              #abort-all-job: true
               kill-phase-on: FAILURE
       - multijob:
           name: CIB-{project}-finish-success
               current-parameters: true
               abort-all-job: true
               kill-phase-on: FAILURE
-              # - multijob:
-              #     name: 'CIBT-{project}-start'
-              #     condition: SUCCESSFUL
-              #     projects:
-              #       - name: 'ci-apps-{project}-verify-CIBT-start'
-              #         current-parameters: true
-              #         abort-all-job: true
-              #         kill-phase-on: FAILURE
-      #- multijob:
-#          name: CIBT-{project}
-#          condition: SUCCESSFUL
-#          projects:
-#            - name: 'ci-apps-{project}-verify-CIBT-porter-nogfx'
-#              current-parameters: true
-#              abort-all-job: true
-#              kill-phase-on: FAILURE
-#            - name: 'ci-apps-{project}-verify-CIBT-intel-corei7-64'
-#              current-parameters: true
-#              abort-all-job: true
-#              kill-phase-on: FAILURE
-#            - name: 'ci-apps-{project}-verify-CIBT-raspberrypi3'
-#              current-parameters: true
-#              abort-all-job: true
-#              kill-phase-on: FAILURE
-#            - name: 'ci-apps-{project}-verify-CIBT-dra7xx-evm'
-#              current-parameters: true
-#              abort-all-job: true
-#              kill-phase-on: FAILURE
-#            - name: 'ci-apps-{project}-verify-CIBT-qemux86-64'
-#              current-parameters: true
-#              abort-all-job: true
-#              kill-phase-on: FAILURE
-#      - multijob:
-#          name: 'CIBT-{project}-finish-success'
-#          condition: SUCCESSFUL
-#          projects:
-#            - name: 'ci-apps-{project}-verify-CIBT-finish-success'
-#              current-parameters: true
-#              abort-all-job: true
-#              kill-phase-on: FAILURE
-
-#    publishers:
-#      - trigger-parameterized-builds:
-#        - project:
-#          - ci-apps-{project}-verify-failure
-#          condition: FAILED
-#          current-parameters: true
 
-#
-# -verify-failure
-# ###################
 
+################################################################################
+# ci-apps-{project}-verify-CIB-{architecture}  =  build job per arch
+################################################################################
 - job-template:
-    name: 'ci-apps-{project}-verify-failure'
+    name: 'ci-apps-{project}-verify-CIB-{architecture}'
     project-type: freestyle
     concurrent: true
-    node: control-slave
-
+    node: agl-test-slave
     parameters:
       - string:
           name: GERRIT_PROJECT
           name: GERRIT_PATCHSET_NUMBER
           default: "2"
           description: "patchset # to build"
+      - string:
+          name: MACHINE
+          default: '{architecture}'
+          description: "Machine to build"
 
     build-discarder:
       days-to-keep: 30
     wrappers:
       - agl-infra-wrappers:
           build-timeout: '{build-timeout}'
+      - openstack:
+          single-use: true
 
     builders:
-      - shell: |
-          set
-          echo "#### Verified -1 ####"
-          #ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified -1 -n NONE --message="CI-cycle\ failed.\ URL:\ ${{BUILD_URL}}" || true
-          ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} -n NONE --message="CI-cycle\ failed.\ URL:\ ${{BUILD_URL}}" || true
+      - shell:
+          # including from ../common into ci-apps-{project}-verify-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-rsync-download-changeid.sh
 
-#
-# CIB-start (unused)
-# ###########
+    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}-verify-CIB-finish-succcess  =  success, msg to gerrit
+################################################################################
 - job-template:
-    name: 'ci-apps-{project}-verify-CIB-start'
+    name: 'ci-apps-{project}-verify-CIB-finish-success'
     project-type: freestyle
     concurrent: true
     node: control-slave
-
     parameters:
       - string:
           name: GERRIT_PROJECT
           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
-
     builders:
       - shell: |
-          #set
-          export TRIGGERURL=$(echo ${{BUILD_URL}} | sed -e 's,-CIB-start.*,,')
-          # ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified=0 --label ci-image-build=0 --label ci-image-boot-test=0 -n NONE --message="CI-Image-Build\ started.\ URL:\ ${{BUILD_URL}}" || true
-          ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified=0 -n NONE --message="CI-Image-Build\ started.\ URL:\ \$TRIGGERURL" || true
-
+          set
+          echo "#### CIB +1 #### Verified +1 ####"
+          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="CI-Image-Build\ finished,\ CIB+1,\ Verified+1" || true
 
-#
-# CIB-{architecture}
-# ##############
 
+################################################################################
+# ci-apps-{project}-verify-failure  =  message back to gerrit on failure
+################################################################################
 - job-template:
-    name: 'ci-apps-{project}-verify-CIB-{architecture}'
+    name: 'ci-apps-{project}-verify-failure'
     project-type: freestyle
     concurrent: true
-    node: agl-test-slave
-
+    node: control-slave
     parameters:
       - string:
           name: GERRIT_PROJECT
           name: GERRIT_PATCHSET_NUMBER
           default: "2"
           description: "patchset # to build"
-      - string:
-          name: MACHINE
-          default: '{architecture}'
-          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:
-          # including from ../common into ci-apps-{project}-verify-CIB-{architecture}
-          !include-raw-escape:
-          - ../common/include-apps-header.sh
-          - ../common/include-apps-fetch-install-sdk.sh
-          - ../common/include-apps-build-app.sh
+      - shell: |
+          set
+          echo "#### Verified -1 ####"
+          #ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified -1 -n NONE --message="CI-cycle\ failed.\ URL:\ ${{BUILD_URL}}" || true
+          ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} -n NONE --message="CI-cycle\ failed.\ URL:\ ${{BUILD_URL}}" || true
+
+
+
+
 
-    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"
 
 
 
-#
-# CIB-finish-success
-# ###################
 
+
+
+################################################################################################################################################################
+################################################################################################################################################################
+################################################################################################################################################################
+################################################################################################################################################################
+
+
+#
+# CIB-start (unused)
+# ###########
 - job-template:
-    name: 'ci-apps-{project}-verify-CIB-finish-success'
+    name: 'ci-apps-{project}-verify-CIB-start'
     project-type: freestyle
     concurrent: true
     node: control-slave
-
     parameters:
       - string:
           name: GERRIT_PROJECT
           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
     builders:
       - shell: |
-          set
-          echo "#### CIB +1 #### Verified +1 ####"
-          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="CI-Image-Build\ finished,\ CIB+1,\ Verified+1" || true
+          #set
+          export TRIGGERURL=$(echo ${{BUILD_URL}} | sed -e 's,-CIB-start.*,,')
+          # ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified=0 --label ci-image-build=0 --label ci-image-boot-test=0 -n NONE --message="CI-Image-Build\ started.\ URL:\ ${{BUILD_URL}}" || true
+          ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified=0 -n NONE --message="CI-Image-Build\ started.\ URL:\ \$TRIGGERURL" || true
+
 
 #
 # CIBT-{architecture} 'BOOT TEST'
diff --git a/jjb/common/include-apps-rsync-download-changeid.sh b/jjb/common/include-apps-rsync-download-changeid.sh
new file mode 100644 (file)
index 0000000..ad07c9f
--- /dev/null
@@ -0,0 +1,32 @@
+#!/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/${TARGETARCH}
+export DEST=$(pwd)/UPLOAD/${TARGETARCH}
+
+pwd 
+
+ls
+
+ls package
+
+
+cp package/*.wgt $DEST
+tree $DEST
+ls -alh $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