From 12ee01db91117005b79a9264d8509a2daf86fa80 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 27 Jun 2018 16:07:20 +0200 Subject: Split yocto builds from yocto selftests In a separate Jenkinsfile right now, with a lot of duplication. Let's hope to find a cleaner way --- scripts/ci/Jenkinsfile.bleeding | 4 +- scripts/ci/Jenkinsfile.bleeding-selftest | 89 ++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 scripts/ci/Jenkinsfile.bleeding-selftest diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding index e50b4b6..6d340fd 100644 --- a/scripts/ci/Jenkinsfile.bleeding +++ b/scripts/ci/Jenkinsfile.bleeding @@ -64,7 +64,7 @@ pipeline { ''' } } - stage('build-core-image-minimal+oe-selftest') { + stage('build-core-image-minimal') { agent { dockerfile { filename 'scripts/ci/Dockerfile.bitbake' @@ -80,8 +80,6 @@ pipeline { sh 'scripts/ci/configure.sh' sh 'scripts/ci/build.sh core-image-minimal' - - sh 'scripts/ci/oe-selftest.sh' } } } diff --git a/scripts/ci/Jenkinsfile.bleeding-selftest b/scripts/ci/Jenkinsfile.bleeding-selftest new file mode 100644 index 0000000..e50b4b6 --- /dev/null +++ b/scripts/ci/Jenkinsfile.bleeding-selftest @@ -0,0 +1,89 @@ +// This CI setup checks out aktualizr, meta-updater and updater-repo and builds +// master branches whenever a change is pushed to any of these + +// define these for docker image creation +node { + // might cause some problems: + // https://stackoverflow.com/questions/44805076/setting-build-args-for-dockerfile-agent-using-a-jenkins-declarative-pipeline + JENKINS_UID = sh(returnStdout: true, script: 'id -u').trim() + JENKINS_GID = sh(returnStdout: true, script: 'id -g').trim() +} + +pipeline { + agent any + environment { + TEST_AKTUALIZR_REMOTE = 'aktualizr' + TEST_AKTUALIZR_DIR = 'aktualizr' + TEST_AKTUALIZR_BRANCH = 'master' + TEST_BITBAKE_COMMON_DIR = "/opt/jenkins/bitbake-common" + } + stages { + stage('checkout') { + steps { + + checkout([$class: 'GitSCM', + userRemoteConfigs: [ + [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] + ], + branches: [[name: 'refs/heads/master']], + extensions: [ + [$class: 'DisableRemotePoll'], + [$class: 'PruneStaleBranch'], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'aktualizr' + ] + ], + ]) + + checkout([$class: 'RepoScm', + manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', + manifestBranch: null, + manifestFile: 'master.xml', + 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, + ]) + + // ignore bitbake build directories in docker + sh 'echo \'build*\' > .dockerignore' + + // 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+oe-selftest') { + agent { + dockerfile { + filename 'scripts/ci/Dockerfile.bitbake' + args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' + additionalBuildArgs "--build-arg uid=${JENKINS_UID} --build-arg gid=${JENKINS_GID}" + reuseNode true + } + } + environment { + TEST_AKTUALIZR_CREDENTIALS = credentials('garage-credentials') + } + steps { + sh 'scripts/ci/configure.sh' + + sh 'scripts/ci/build.sh core-image-minimal' + + sh 'scripts/ci/oe-selftest.sh' + } + } + } +} +// vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: -- cgit v1.2.3-54-g00ecf