diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2021-03-10 13:41:08 +0000 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2021-03-10 13:48:34 +0000 |
commit | 49327a3679e3fad395fc42cff14691364290d568 (patch) | |
tree | 645808ae73006a1a00377bdc10492bed7ecb6c2d /jjb | |
parent | f82cd14def7370b5be40f7bb5fb0d8206e0db1dd (diff) |
SPEC-3414: generate BUILD_VERSION early
We will need to push build info before generating jobs.
So first unify build version under an uniq variable name BUILD_VERSION.
And generate this early.
Bug-AGL: SPEC-3414
Change-Id: Ieba092b2c9d86f9b9feee45a02b553b6cf49fecf
Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/common/include-agl-app-run-test-short.sh | 7 | ||||
-rw-r--r-- | jjb/common/include-agl-run-test-short-release.sh | 7 | ||||
-rw-r--r-- | jjb/common/include-agl-run-test-short.sh | 14 |
3 files changed, 19 insertions, 9 deletions
diff --git a/jjb/common/include-agl-app-run-test-short.sh b/jjb/common/include-agl-app-run-test-short.sh index 239e2baf..e1bd6998 100644 --- a/jjb/common/include-agl-app-run-test-short.sh +++ b/jjb/common/include-agl-app-run-test-short.sh @@ -10,6 +10,9 @@ cd $REPODIR +BUILD_VERSION="AGL-app-gerrit-$GERRIT_CHANGE_NUMBER-$GERRIT_PATCHSET_NUMBER" +[[ -e output/repo-manifest-r.txt.sha1 ]] && BUILD_VERSION+="-$(cat output/repo-manifest-r.txt.sha1)" + echo "# LAVA lab target: ${LAVA_LAB} #" # releng-scripts depends on jinja2 >= 2.9 echo "## Check version of python-jinja2: " @@ -34,12 +37,12 @@ CREATE_ARGS+="--build-type snapshot --branch master --version latest " [[ ! -z $GERRIT_CHANGE_NUMBER ]] && CREATE_ARGS+="--app-changeid $GERRIT_CHANGE_NUMBER " [[ ! -z $GERRIT_PATCHSET_NUMBER ]] && CREATE_ARGS+="--app-patchset $GERRIT_PATCHSET_NUMBER " [[ ! -z $AGLBRANCH ]] && CREATE_ARGS+="--app-branch $AGLBRANCH " -BUILD_VERSION="AGL-app-gerrit-$GERRIT_CHANGE_NUMBER-$GERRIT_PATCHSET_NUMBER" -[[ -e output/repo-manifest-r.txt.sha1 ]] && BUILD_VERSION+="-$(cat output/repo-manifest-r.txt.sha1)" CREATE_ARGS+="--name AGL-gerrit-$GERRIT_CHANGE_NUMBER-$GERRIT_PATCHSET_NUMBER " CREATE_ARGS+="--build-version $BUILD_VERSION " CREATE_ARGS+="--callback-from ${LAVA_LAB} " CREATE_ARGS+="--test application-lifecycle pyagl" + +echo "DEBUG: call create-jobs.py with $CREATE_ARGS" $RELENG/utils/create-jobs.py ${CREATE_ARGS} > testjob.yaml if [ $? != 0 ]; then diff --git a/jjb/common/include-agl-run-test-short-release.sh b/jjb/common/include-agl-run-test-short-release.sh index 53011b50..7b13784e 100644 --- a/jjb/common/include-agl-run-test-short-release.sh +++ b/jjb/common/include-agl-run-test-short-release.sh @@ -9,6 +9,9 @@ cd $REPODIR +BUILD_VERSION="AGL-gerrit-$RELEASE_BRANCH-$RELEASE_VERSION" +[[ -e output/repo-manifest-r.txt.sha1 ]] && BUILD_VERSION+="-$(cat output/repo-manifest-r.txt.sha1)" + echo "# LAVA lab target: ${LAVA_LAB} #" # releng-scripts depends on jinja2 >= 2.9 echo "## Check version of python-jinja2: " @@ -18,11 +21,11 @@ CREATE_ARGS+="--machine ${releng_device} " CREATE_ARGS+="--build-type release " [[ ! -z $RELEASE_BRANCH ]] && CREATE_ARGS+="--branch $RELEASE_BRANCH " [[ ! -z $RELEASE_VERSION ]] && CREATE_ARGS+="--version $RELEASE_VERSION " -BUILD_VERSION="AGL-gerrit-$RELEASE_BRANCH-$RELEASE_VERSION" -[[ -e output/repo-manifest-r.txt.sha1 ]] && BUILD_VERSION+="-$(cat output/repo-manifest-r.txt.sha1)" CREATE_ARGS+="--name AGL-gerrit-$RELEASE_BRANCH-$RELEASE_VERSION " CREATE_ARGS+="--build-version $BUILD_VERSION " CREATE_ARGS+="--callback-from ${LAVA_LAB} " + +echo "DEBUG: call create-jobs.py with $CREATE_ARGS" $RELENG/utils/create-jobs.py ${CREATE_ARGS} > testjob.yaml if [ $? != 0 ]; then diff --git a/jjb/common/include-agl-run-test-short.sh b/jjb/common/include-agl-run-test-short.sh index 92a38140..09e2509b 100644 --- a/jjb/common/include-agl-run-test-short.sh +++ b/jjb/common/include-agl-run-test-short.sh @@ -18,6 +18,13 @@ if [ -e build-info ]; then source build-info fi +BUILD_VERSION="" +if [[ ! -z $DIST_BUILD_TOPIC ]]; then + BUILD_VERSION="$DIST_BUILD_TOPIC" +else + [[ ! -z $DIST_BB_DISTRO_VERSION ]] && BUILD_VERSION="$DIST_BB_DISTRO_VERSION-${DIST_LAYERS_MD5:0:8}" +fi + echo "# LAVA lab target: ${LAVA_LAB} #" # releng-scripts depends on jinja2 >= 2.9 echo "## Check version of python-jinja2: " @@ -28,11 +35,7 @@ CREATE_ARGS+="--build-type ci " [[ ! -z $GERRIT_CHANGE_NUMBER ]] && CREATE_ARGS+="--changeid $GERRIT_CHANGE_NUMBER " [[ ! -z $GERRIT_PATCHSET_NUMBER ]] && CREATE_ARGS+="--patchset $GERRIT_PATCHSET_NUMBER " CREATE_ARGS+="--name AGL-gerrit-$GERRIT_CHANGE_NUMBER-$GERRIT_PATCHSET_NUMBER " -if [[ ! -z $DIST_BUILD_TOPIC ]]; then - CREATE_ARGS+="--build-version $DIST_BUILD_TOPIC " -else - [[ ! -z $DIST_BB_DISTRO_VERSION ]] && CREATE_ARGS+="--build-version $DIST_BB_DISTRO_VERSION-${DIST_LAYERS_MD5:0:8} " -fi +[[ ! -z "$BUILD_VERSION" ]] && CREATE_ARGS+="--build-version $BUILD_VERSION" [[ ! -z $DIST_BUILD_HASH ]] && CREATE_ARGS+="--commit $DIST_BUILD_HASH " [[ ! -z $DIST_BUILD_ID ]] && CREATE_ARGS+="--build-id $DIST_BUILD_ID " [[ ! -z $DIST_BB_AGL_BRANCH ]] && CREATE_ARGS+="--branch $DIST_BB_AGL_BRANCH " @@ -41,6 +44,7 @@ CREATE_ARGS+="--callback-from ${LAVA_LAB} " if [[ ! -z $lavacli_tags ]]; then CREATE_ARGS+="--device-tags ${lavacli_tags} " fi +echo "DEBUG: call create-jobs.py with $CREATE_ARGS" $RELENG/utils/create-jobs.py ${CREATE_ARGS} > testjob.yaml if [ $? != 0 ]; then |