diff options
author | 2017-09-28 13:59:36 +0200 | |
---|---|---|
committer | 2017-09-28 13:59:36 +0200 | |
commit | 43045124a49c1540882bd6bd7e00e4a4addac047 (patch) | |
tree | eef83f3ffee44b71723bdd059ad0ba25b4eaf2d7 /jjb | |
parent | 6e4b7d92946533bfc14bf067598277f05513431f (diff) |
After merge, rebuild app
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>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/ci-apps-verify/ci-apps-jjb.yaml | 310 | ||||
-rw-r--r-- | jjb/common/include-apps-header.sh | 9 | ||||
-rw-r--r-- | jjb/common/include-apps-prepare-upload-folder-merged.sh | 46 | ||||
-rw-r--r-- | jjb/common/include-apps-rsync-download-apprepo.sh | 18 |
4 files changed, 324 insertions, 59 deletions
diff --git a/jjb/ci-apps-verify/ci-apps-jjb.yaml b/jjb/ci-apps-verify/ci-apps-jjb.yaml index a7a3018c..bd50f505 100644 --- a/jjb/ci-apps-verify/ci-apps-jjb.yaml +++ b/jjb/ci-apps-verify/ci-apps-jjb.yaml @@ -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 @@ -40,6 +43,10 @@ - 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 @@ -298,9 +306,58 @@ +################################################################################################################################################################ +################################################################################################################################################################ +################# 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 @@ -308,6 +365,209 @@ ################################################################################################################################################################ ################################################################################################################################################################ + +################# 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 ############################################################################################################################################################### ################################################################################################################################################################ ################################################################################################################################################################ @@ -529,53 +789,3 @@ - - -################################################################################ -################################################################################ -# -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 - diff --git a/jjb/common/include-apps-header.sh b/jjb/common/include-apps-header.sh index da084eda..9afcbde6 100644 --- a/jjb/common/include-apps-header.sh +++ b/jjb/common/include-apps-header.sh @@ -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 index 00000000..37b5887f --- /dev/null +++ b/jjb/common/include-apps-prepare-upload-folder-merged.sh @@ -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 index 00000000..3d8e1e10 --- /dev/null +++ b/jjb/common/include-apps-rsync-download-apprepo.sh @@ -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 |