From 55e49cdb4b2d1d818844703a44483ff92041d80d Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 8 Jun 2018 15:43:32 +0200 Subject: Checkout of repo from Jenkins --- scripts/ci/Jenkinsfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/ci/Jenkinsfile (limited to 'scripts/ci') diff --git a/scripts/ci/Jenkinsfile b/scripts/ci/Jenkinsfile new file mode 100644 index 0000000..0b4afa9 --- /dev/null +++ b/scripts/ci/Jenkinsfile @@ -0,0 +1,27 @@ +pipeline { + agent any + stages { + stage('checkout') { + steps { + checkout([$class: 'RepoScm', + manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', + manifestBranch: null, + manifestFile: null, + manifestGroup: null, + mirrorDir: null, + jobs: 0, + depth: 0, + localManifest: null, + destinationDir: 'updater-repo', + repoUrl: null, + currentBranch: false, + resetFirst: true, + quiet: false, + trace: false, + showAllChanges: false, + ]) + } + } + } +} +// vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: -- cgit v1.2.3-54-g00ecf From 855b031e7597b0c16b2bd9f4c18321b6320c8ffe Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 12 Jun 2018 14:48:48 +0200 Subject: Bitbake build from Jenkins --- scripts/ci/Jenkinsfile | 29 +++++++++++++++++++++++++++-- scripts/ci/build.sh | 18 ++++++++++++++++++ scripts/ci/configure.sh | 33 +++++++++++++++++++++++++++++++++ scripts/ci/local.conf.append | 5 +++++ 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100755 scripts/ci/build.sh create mode 100755 scripts/ci/configure.sh create mode 100644 scripts/ci/local.conf.append (limited to 'scripts/ci') diff --git a/scripts/ci/Jenkinsfile b/scripts/ci/Jenkinsfile index 0b4afa9..e7bcf6c 100644 --- a/scripts/ci/Jenkinsfile +++ b/scripts/ci/Jenkinsfile @@ -1,12 +1,20 @@ pipeline { - agent any + agent none + environment { + TEST_LOCAL_CONF_APPEND = 'scripts/ci/local.conf.append' + TEST_AKTUALIZR_DIR = '.' + TEST_AKTUALIZR_BRANCH = 'aktualizr/master' + } stages { stage('checkout') { + agent { + label 'bitbake' + } steps { checkout([$class: 'RepoScm', manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', manifestBranch: null, - manifestFile: null, + manifestFile: 'master.xml', manifestGroup: null, mirrorDir: null, jobs: 0, @@ -20,6 +28,23 @@ pipeline { trace: false, showAllChanges: false, ]) + + // override meta-updater commit with currently tested branch + sh ''' + META_UPDATER_COMMIT=$(git rev-parse HEAD) + cd updater-repo/meta-updater + git checkout $META_UPDATER_COMMIT + ''' + } + } + stage('build-core-image-minimal') { + agent { + label 'bitbake' + } + steps { + sh 'scripts/ci/configure.sh' + + sh 'scripts/ci/build.sh core-image-minimal' } } } diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh new file mode 100755 index 0000000..6235428 --- /dev/null +++ b/scripts/ci/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euo pipefail +set -x + +TEST_MACHINE=${TEST_MACHINE:-qemux86-64} +TEST_BUILD_DIR=${TEST_BUILD_DIR:-build} +TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} + +IMAGE_NAME=${1:-core-image-minimal} + +( +set +euo pipefail +set +x +. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" + +bitbake "${IMAGE_NAME}" +) diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh new file mode 100755 index 0000000..36ed059 --- /dev/null +++ b/scripts/ci/configure.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -euo pipefail +set -x + +TEST_MACHINE=${TEST_MACHINE:-qemux86-64} +TEST_BUILD_DIR=${TEST_BUILD_DIR:-build} +TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} + +TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} +TEST_LOCAL_CONF_APPEND=${TEST_LOCAL_CONF_APPEND:-} +TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} +TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="${TEST_AKTUALIZR_DIR}/.git" git rev-parse "${TEST_AKTUALIZR_BRANCH}")} + +# remove existing local.conf, keep +rm -rf "${TEST_BUILD_DIR}/conf.old" || true +mv "${TEST_BUILD_DIR}/conf" "${TEST_BUILD_DIR}/conf.old" || true + +( +set +euo pipefail +set +x +echo ">> Running envsetup.sh" +. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" +) + +if [[ -n $TEST_LOCAL_CONF_APPEND ]]; then + echo ">> Appending to local.conf" + REMOTE_AKTUALIZR_BRANCH=$(sed 's#^[^/]*/##g' <<< "$TEST_AKTUALIZR_BRANCH") + cat "$TEST_LOCAL_CONF_APPEND" | \ + sed "s/\$/$TEST_AKTUALIZR_REV/g" | \ + sed "s/\$/$REMOTE_AKTUALIZR_BRANCH/g" \ + >> "${TEST_BUILD_DIR}/conf/local.conf" +fi diff --git a/scripts/ci/local.conf.append b/scripts/ci/local.conf.append new file mode 100644 index 0000000..350e466 --- /dev/null +++ b/scripts/ci/local.conf.append @@ -0,0 +1,5 @@ +SANITY_TESTED_DISTROS = "" +SRCREV_pn-aktualizr = "$" +SRCREV_pn-aktualizr-native = "${SRCREV_pn-aktualizr}" +BRANCH_pn-aktualizr = "$" +BRANCH_pn-aktualizr-native = "${BRANCH_pn-aktualizr}" -- cgit v1.2.3-54-g00ecf From 8d021e159daf094d6056654a1ff5957353357163 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Mon, 18 Jun 2018 11:52:05 +0200 Subject: Try to checkout aktualizr from pipeline --- scripts/ci/Jenkinsfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts/ci') diff --git a/scripts/ci/Jenkinsfile b/scripts/ci/Jenkinsfile index e7bcf6c..83bd49c 100644 --- a/scripts/ci/Jenkinsfile +++ b/scripts/ci/Jenkinsfile @@ -2,8 +2,8 @@ pipeline { agent none environment { TEST_LOCAL_CONF_APPEND = 'scripts/ci/local.conf.append' - TEST_AKTUALIZR_DIR = '.' - TEST_AKTUALIZR_BRANCH = 'aktualizr/master' + TEST_AKTUALIZR_DIR = 'aktualizr' + TEST_AKTUALIZR_BRANCH = 'origin/master' } stages { stage('checkout') { @@ -11,6 +11,15 @@ pipeline { label 'bitbake' } steps { + dir('aktualizr') { + checkout([$class: 'GitSCM', + userRemoteConfigs: [[url: 'https://github.com/advancedtelematic/aktualizr']], + branches: [[name: '*/master']], + changelog: true, + poll: true, + ]) + } + checkout([$class: 'RepoScm', manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', manifestBranch: null, -- cgit v1.2.3-54-g00ecf