diff options
author | 2017-06-09 19:16:00 +0200 | |
---|---|---|
committer | 2017-06-09 22:03:01 +0200 | |
commit | cf1fc8e08722790752176df0d875a1be8e9c3a32 (patch) | |
tree | 8607eda81c8c6e543bc0861881482053b204e295 | |
parent | 60ab5c6e78b375c51051a7eacccf5f9ba3c9b37f (diff) |
Update application build to support multiarch builds and upload
Change-Id: I1998a8a0ae8ad16029fb834e87f06cdc760426d1
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
-rw-r--r-- | jjb/ci-apps-verify/.gitignore | 2 | ||||
-rwxr-xr-x | jjb/ci-apps-verify/ci-apps-jjb.local.sh | 37 | ||||
-rw-r--r-- | jjb/ci-apps-verify/ci-apps-jjb.yaml | 60 | ||||
-rw-r--r-- | jjb/common/include-apps-build-app.sh | 23 | ||||
-rw-r--r-- | jjb/common/include-apps-fetch-install-sdk.sh | 19 | ||||
-rw-r--r-- | jjb/common/include-apps-header.sh | 20 | ||||
-rw-r--r-- | jjb/common/include-apps-rsync-download-changeid.sh | 12 |
7 files changed, 138 insertions, 35 deletions
diff --git a/jjb/ci-apps-verify/.gitignore b/jjb/ci-apps-verify/.gitignore index ce14f834..748bbba1 100644 --- a/jjb/ci-apps-verify/.gitignore +++ b/jjb/ci-apps-verify/.gitignore @@ -1,3 +1,5 @@ mediaplayer controls poky-agl-*.sh +env* +UPLOAD diff --git a/jjb/ci-apps-verify/ci-apps-jjb.local.sh b/jjb/ci-apps-verify/ci-apps-jjb.local.sh index cb588b23..0e7c3b51 100755 --- a/jjb/ci-apps-verify/ci-apps-jjb.local.sh +++ b/jjb/ci-apps-verify/ci-apps-jjb.local.sh @@ -1,15 +1,44 @@ #!/bin/bash -set -x +#set -x -export GERRIT_REFSPEC="refs/changes/49/9549/2" +export GERRIT_REFSPEC="refs/changes/51/9551/2" export GERRIT_PROJECT="apps/mediaplayer" -export GERRIT_CHANGE_NUMBER="9549" +export GERRIT_CHANGE_NUMBER="9551" export GERRIT_PATCHSET_NUMBER="2" -export GERRIT_PATCHSET_REVISION="b0f682b1579e520896ccd5492d6666d962a0c226" +export GERRIT_PATCHSET_REVISION="f3ddc376291262a6b305cc2b0a52792abdc7c85c" export GERRIT_HOST="gerrit.automotivelinux.org" export GERRIT_PORT="29418" +export -p > env.save + +THISPWD=$(pwd) +for TARGETARCH in aarch64 arm x86-64; do +pushd $THISPWD + +for i in `compgen -e | grep -v ^PATH`; do + unset $i +done + +source env.save + +#set -x +#export GERRIT_REFSPEC=\"$GERRIT_REFSPEC\" +#export GERRIT_PROJECT=\"$GERRIT_PROJECT\" +#export GERRIT_CHANGE_NUMBER=\"$GERRIT_CHANGE_NUMBER\" +#export GERRIT_PATCHSET_NUMBER=\"$GERRIT_PATCHSET_NUMBER\" +#export GERRIT_PATCHSET_REVISION=\"$GERRIT_PATCHSET_REVISION\" +#export GERRIT_HOST=\"$GERRIT_HOST\" +#export GERRIT_PORT=\"$GERRIT_PORT\" +rm -rf ~/agl-sdk || true + . ../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 + +#" + +popd + +done
\ No newline at end of file diff --git a/jjb/ci-apps-verify/ci-apps-jjb.yaml b/jjb/ci-apps-verify/ci-apps-jjb.yaml index 137de8fe..9b56ac25 100644 --- a/jjb/ci-apps-verify/ci-apps-jjb.yaml +++ b/jjb/ci-apps-verify/ci-apps-jjb.yaml @@ -29,7 +29,7 @@ - ci-apps-{project}-verify-CIB-{architecture} - ci-apps-{project}-verify-CIB-finish-success - ci-apps-{project}-verify-failure - + - ci-apps-{project}-remove-artifacts # - ci-apps-{project}-verify-CIB-start # - ci-apps-{project}-verify-CIBT-start #- ci-apps-{project}-verify-CIBT-{architecture} @@ -144,14 +144,14 @@ description: "refspec to build" - string: name: GERRIT_CHANGE_NUMBER - default: "8313" + default: "" description: "change # to build" - string: name: GERRIT_PATCHSET_NUMBER - default: "2" + default: "" description: "patchset # to build" - string: - name: MACHINE + name: TARGETARCH default: '{architecture}' description: "Machine to build" @@ -497,3 +497,55 @@ # set echo "#### CIBT +1 ####" ssh -p 29418 agl-jobbuilder@gerrit.automotivelinux.org gerrit review ${{GERRIT_CHANGE_NUMBER}},${{GERRIT_PATCHSET_NUMBER}} --verified +1 --label ci-image-build=+1 --label ci-image-boot-test=+1 -n NONE --message='CI-Image-Boot-Test\ finished' || true + +################################################################################ +################################################################################ +# -remove-artifacts = merge/abandon, remove artifacts and later trigger sstate +################################################################################ +- job-template: + name: 'ci-apps-{project}-remove-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: master + description: "branch to build" + - string: + name: GERRIT_REFSPEC + default: refs/heads/master + 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-patch-merged: + name: 'apps/{project}' + branch: '**/**/**' + - gerrit-trigger-patch-abandoned: + name: 'apps/{project}' + branch: '**/**/**' + builders: + - shell: + !include-raw-escape: + - ../common/include-agl-remove-artifacts-changeid.sh + diff --git a/jjb/common/include-apps-build-app.sh b/jjb/common/include-apps-build-app.sh index 8940ac00..f46c7f8d 100644 --- a/jjb/common/include-apps-build-app.sh +++ b/jjb/common/include-apps-build-app.sh @@ -46,13 +46,26 @@ if [[ ! x"yes" = x"$HANDLED" ]] && $(echo "$TARGETPROJECT" | grep -q "apps/"); t # clone git rm -rf ${MYPROJECT} - git clone https://${GERRIT_HOST}/gerrit/${GERRIT_PROJECT}.git pushd ${MYPROJECT} - git log -1 - git fetch ${TARGET_REFSPEC} - git reset --hard FETCH_HEAD - git log -1 + git log -1 --pretty=oneline + if test x"" != x"${TARGETREFSPEC}" ; then + git fetch origin ${TARGETREFSPEC} + git reset --hard FETCH_HEAD + else + # try + # GERRIT_CHANGE_NUMBER="9551" + # GERRIT_PATCHSET_NUMBER="2" + if ( test x"" != x"${GERRIT_CHANGE_NUMBER}" -a x"" != x"${GERRIT_PATCHSET_NUMBER}" ) ; then + pip install --user git-review + git review -d ${GERRIT_CHANGE_NUMBER},${GERRIT_PATCHSET_NUMBER} + fi + sleep 2 + # if not reset, we leave it to master + fi + git log -1 --pretty=oneline + + # Fixme: use aglbuild script if test -f Makefile ; then make make package diff --git a/jjb/common/include-apps-fetch-install-sdk.sh b/jjb/common/include-apps-fetch-install-sdk.sh index ad220501..b099d9a5 100644 --- a/jjb/common/include-apps-fetch-install-sdk.sh +++ b/jjb/common/include-apps-fetch-install-sdk.sh @@ -28,23 +28,22 @@ fi chmod a+x ${TARGETSDKNAME} -eval export TARGETSDKENVSCRIPT="${SDKHOSTDIR}/environment-setup-${TARGETSDKARCH}-agl-linux-gnueabi" - -if test ! -f ${TARGETSDKENVSCRIPT} ; then +if test x"" = x"$(eval ls ${SDKHOSTDIR}/environment-setup* | grep "agl-" | grep ${TARGETSDKARCH} 2>/dev/null)" ; then bash ${TARGETSDKNAME} -d ${SDKHOSTDIR}/ -y fi +#set -x + +# find out the env setup script +export TARGETSDKENVSCRIPT="$(eval ls ${SDKHOSTDIR}/environment-setup* | grep "agl-" | grep ${TARGETSDKARCH} 2>/dev/null)" + if test ! -f ${TARGETSDKENVSCRIPT} ; then echo "Script not there after extracting sdk ?!" echo "Abort." exit 1 fi +echo "About to source ${TARGETSDKENVSCRIPT}" source "${TARGETSDKENVSCRIPT}" +#set | grep -i sysroots || true +#set +x -echo "###############################################################################" -ls -alh ~/ -echo "###############################################################################" -ls -alh -echo "###############################################################################" -set -echo "###############################################################################" diff --git a/jjb/common/include-apps-header.sh b/jjb/common/include-apps-header.sh index 7c60b1af..eb57c926 100644 --- a/jjb/common/include-apps-header.sh +++ b/jjb/common/include-apps-header.sh @@ -25,12 +25,17 @@ function dprint() { } #export TARGETARCHALL="arm aarch64 x86-64" +#set | grep arm +#set | grep aarch64 +#set | grep x86-64 -if test x"" = x"${architecture}"; then - export TARGETARCH="arm" -else - export TARGETARCH="${architecture}" -fi +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 @@ -126,3 +131,8 @@ if test x"" = x"$TARGETSDKMACHINE" ; then echo "No TARGETSDKMACHINE variable. Exiting." exit 1 fi + + +echo "################################################################################" +set | grep ^TARGET +echo "################################################################################" diff --git a/jjb/common/include-apps-rsync-download-changeid.sh b/jjb/common/include-apps-rsync-download-changeid.sh index ad07c9f1..d6e9f8a3 100644 --- a/jjb/common/include-apps-rsync-download-changeid.sh +++ b/jjb/common/include-apps-rsync-download-changeid.sh @@ -12,21 +12,19 @@ export RSYNCDST="/srv/download/AGL/upload/ci/${GERRIT_CHANGE_NUMBER}/${GERRIT_PA export RSYNCSRC=$(pwd)/UPLOAD/ # construct upload folder -mv UPLOAD UPLOAD2 || true -rm -rf UPLOAD2 || true +#mv UPLOAD UPLOAD2 || true +rm -rf UPLOAD/${TARGETARCH} || true mkdir -p UPLOAD/${TARGETARCH} export DEST=$(pwd)/UPLOAD/${TARGETARCH} -pwd - +pushd ${MYPROJECT} ls - ls package - cp package/*.wgt $DEST -tree $DEST ls -alh $DEST +LANG=C tree $RSYNCSRC +popd 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 |