From b9af996f83ff22bfd2ff9e2777e087934bdcc09c Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 26 Jun 2019 17:33:36 +0200 Subject: Move ci files Signed-off-by: Laurent Bonnans --- ci/Dockerfile.bitbake | 42 +++++++++++++++ ci/Jenkinsfile.bleeding | 87 ++++++++++++++++++++++++++++++ ci/Jenkinsfile.bleeding-selftest | 91 ++++++++++++++++++++++++++++++++ ci/README.adoc | 14 +++++ ci/build.sh | 18 +++++++ ci/configure.sh | 65 +++++++++++++++++++++++ ci/oe-selftest.sh | 18 +++++++ scripts/ci/Dockerfile.bitbake | 42 --------------- scripts/ci/Jenkinsfile.bleeding | 87 ------------------------------ scripts/ci/Jenkinsfile.bleeding-selftest | 91 -------------------------------- scripts/ci/README.adoc | 14 ----- scripts/ci/build.sh | 18 ------- scripts/ci/configure.sh | 65 ----------------------- scripts/ci/oe-selftest.sh | 18 ------- 14 files changed, 335 insertions(+), 335 deletions(-) create mode 100644 ci/Dockerfile.bitbake create mode 100644 ci/Jenkinsfile.bleeding create mode 100644 ci/Jenkinsfile.bleeding-selftest create mode 100644 ci/README.adoc create mode 100755 ci/build.sh create mode 100755 ci/configure.sh create mode 100755 ci/oe-selftest.sh delete mode 100644 scripts/ci/Dockerfile.bitbake delete mode 100644 scripts/ci/Jenkinsfile.bleeding delete mode 100644 scripts/ci/Jenkinsfile.bleeding-selftest delete mode 100644 scripts/ci/README.adoc delete mode 100755 scripts/ci/build.sh delete mode 100755 scripts/ci/configure.sh delete mode 100755 scripts/ci/oe-selftest.sh diff --git a/ci/Dockerfile.bitbake b/ci/Dockerfile.bitbake new file mode 100644 index 0000000..c91f94c --- /dev/null +++ b/ci/Dockerfile.bitbake @@ -0,0 +1,42 @@ +FROM debian:stable +LABEL Description="Image for bitbaking" + +RUN sed -i 's#deb http://deb.debian.org/debian stable main#deb http://deb.debian.org/debian stable main contrib#g' /etc/apt/sources.list +RUN sed -i 's#deb http://deb.debian.org/debian stable-updates main#deb http://deb.debian.org/debian stable-updates main contrib#g' /etc/apt/sources.list +RUN apt-get update -q && apt-get install -qy \ + build-essential \ + bzip2 \ + chrpath \ + cpio \ + default-jre \ + diffstat \ + gawk \ + gcc-multilib \ + git-core \ + iputils-ping \ + iproute \ + libpython-dev \ + libsdl1.2-dev \ + locales \ + ovmf \ + procps \ + python \ + python3 \ + python3-pexpect \ + qemu \ + socat \ + texinfo \ + unzip \ + wget \ + xterm \ + xz-utils + +ARG uid=1000 +ARG gid=1000 +RUN groupadd -g $gid bitbake +RUN useradd -m -u $uid -g $gid bitbake + +RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen +ENV LC_ALL="en_US.UTF-8" +ENV LANG="en_US.UTF-8" +ENV LANGUAGE="en_US.UTF-8" diff --git a/ci/Jenkinsfile.bleeding b/ci/Jenkinsfile.bleeding new file mode 100644 index 0000000..6d340fd --- /dev/null +++ b/ci/Jenkinsfile.bleeding @@ -0,0 +1,87 @@ +// 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') { + 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' + } + } + } +} +// vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: diff --git a/ci/Jenkinsfile.bleeding-selftest b/ci/Jenkinsfile.bleeding-selftest new file mode 100644 index 0000000..8c2d1de --- /dev/null +++ b/ci/Jenkinsfile.bleeding-selftest @@ -0,0 +1,91 @@ +// 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 { + node { label 'bitbake' } + } + 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: diff --git a/ci/README.adoc b/ci/README.adoc new file mode 100644 index 0000000..222982b --- /dev/null +++ b/ci/README.adoc @@ -0,0 +1,14 @@ += Jenkins setup for running meta-updater CI + +As bitbake is quite resource-hungry, there are some special steps that are +needed to run Jenkins CI tasks: + +- docker should be installed and the `jenkins` unix user should belong to + the `docker` group +- `/opt/jenkins` should exist and have `jenkins:jenkins` permissions, it + will be mapped as a volume on the same location in the docker build + container + +Note that for nodes running Jenkins slaves as a docker container, the +`/opt/jenkins` directory must exist on the host system as well, with +permissions matching the user and groupd ids in Jenkins' docker diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 0000000..6235428 --- /dev/null +++ b/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/ci/configure.sh b/ci/configure.sh new file mode 100755 index 0000000..960a0cc --- /dev/null +++ b/ci/configure.sh @@ -0,0 +1,65 @@ +#!/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_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} + +TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} +TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} +TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} +TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} + +# move existing conf directory to backup, before generating a new one +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" +) + +set +x + +SITE_CONF="$TEST_BUILD_DIR/conf/site.conf" + +echo ">> Set common bitbake config options" +cat << EOF > "$SITE_CONF" +SANITY_TESTED_DISTROS = "" +SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH" +IMAGE_FEATURES += "ssh-server-openssh" + +EOF + +echo ">> Set aktualizr branch in bitbake's config" +cat << EOF >> "$SITE_CONF" +SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" +SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" +BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" +BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" + +EOF + +if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then + echo ">> Set aktualizr credentials" + cat << EOF >> "$SITE_CONF" +SOTA_PACKED_CREDENTIALS = "$TEST_AKTUALIZR_CREDENTIALS" +EOF +fi + +if [[ -n $TEST_BITBAKE_COMMON_DIR ]]; then + echo ">> Set caching" + SSTATE_DIR="$TEST_BITBAKE_COMMON_DIR/sstate-cache" + DL_DIR="$TEST_BITBAKE_COMMON_DIR/downloads" + mkdir -p "$SSTATE_DIR" "$DL_DIR" + + cat << EOF >> "$SITE_CONF" +SSTATE_DIR = "$SSTATE_DIR" +DL_DIR = "$DL_DIR" +EOF +fi diff --git a/ci/oe-selftest.sh b/ci/oe-selftest.sh new file mode 100755 index 0000000..3124cce --- /dev/null +++ b/ci/oe-selftest.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# run meta-updater's oe-selftests + +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} + +( +set +euo pipefail +set +x +. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" + +oe-selftest -r updater +) diff --git a/scripts/ci/Dockerfile.bitbake b/scripts/ci/Dockerfile.bitbake deleted file mode 100644 index c91f94c..0000000 --- a/scripts/ci/Dockerfile.bitbake +++ /dev/null @@ -1,42 +0,0 @@ -FROM debian:stable -LABEL Description="Image for bitbaking" - -RUN sed -i 's#deb http://deb.debian.org/debian stable main#deb http://deb.debian.org/debian stable main contrib#g' /etc/apt/sources.list -RUN sed -i 's#deb http://deb.debian.org/debian stable-updates main#deb http://deb.debian.org/debian stable-updates main contrib#g' /etc/apt/sources.list -RUN apt-get update -q && apt-get install -qy \ - build-essential \ - bzip2 \ - chrpath \ - cpio \ - default-jre \ - diffstat \ - gawk \ - gcc-multilib \ - git-core \ - iputils-ping \ - iproute \ - libpython-dev \ - libsdl1.2-dev \ - locales \ - ovmf \ - procps \ - python \ - python3 \ - python3-pexpect \ - qemu \ - socat \ - texinfo \ - unzip \ - wget \ - xterm \ - xz-utils - -ARG uid=1000 -ARG gid=1000 -RUN groupadd -g $gid bitbake -RUN useradd -m -u $uid -g $gid bitbake - -RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen -ENV LC_ALL="en_US.UTF-8" -ENV LANG="en_US.UTF-8" -ENV LANGUAGE="en_US.UTF-8" diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding deleted file mode 100644 index 6d340fd..0000000 --- a/scripts/ci/Jenkinsfile.bleeding +++ /dev/null @@ -1,87 +0,0 @@ -// 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') { - 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' - } - } - } -} -// vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: diff --git a/scripts/ci/Jenkinsfile.bleeding-selftest b/scripts/ci/Jenkinsfile.bleeding-selftest deleted file mode 100644 index 8c2d1de..0000000 --- a/scripts/ci/Jenkinsfile.bleeding-selftest +++ /dev/null @@ -1,91 +0,0 @@ -// 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 { - node { label 'bitbake' } - } - 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: diff --git a/scripts/ci/README.adoc b/scripts/ci/README.adoc deleted file mode 100644 index 222982b..0000000 --- a/scripts/ci/README.adoc +++ /dev/null @@ -1,14 +0,0 @@ -= Jenkins setup for running meta-updater CI - -As bitbake is quite resource-hungry, there are some special steps that are -needed to run Jenkins CI tasks: - -- docker should be installed and the `jenkins` unix user should belong to - the `docker` group -- `/opt/jenkins` should exist and have `jenkins:jenkins` permissions, it - will be mapped as a volume on the same location in the docker build - container - -Note that for nodes running Jenkins slaves as a docker container, the -`/opt/jenkins` directory must exist on the host system as well, with -permissions matching the user and groupd ids in Jenkins' docker diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh deleted file mode 100755 index 6235428..0000000 --- a/scripts/ci/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/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 deleted file mode 100755 index 960a0cc..0000000 --- a/scripts/ci/configure.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/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_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} - -TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} -TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} -TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} -TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} - -# move existing conf directory to backup, before generating a new one -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" -) - -set +x - -SITE_CONF="$TEST_BUILD_DIR/conf/site.conf" - -echo ">> Set common bitbake config options" -cat << EOF > "$SITE_CONF" -SANITY_TESTED_DISTROS = "" -SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH" -IMAGE_FEATURES += "ssh-server-openssh" - -EOF - -echo ">> Set aktualizr branch in bitbake's config" -cat << EOF >> "$SITE_CONF" -SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" -SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" -BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" -BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" - -EOF - -if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then - echo ">> Set aktualizr credentials" - cat << EOF >> "$SITE_CONF" -SOTA_PACKED_CREDENTIALS = "$TEST_AKTUALIZR_CREDENTIALS" -EOF -fi - -if [[ -n $TEST_BITBAKE_COMMON_DIR ]]; then - echo ">> Set caching" - SSTATE_DIR="$TEST_BITBAKE_COMMON_DIR/sstate-cache" - DL_DIR="$TEST_BITBAKE_COMMON_DIR/downloads" - mkdir -p "$SSTATE_DIR" "$DL_DIR" - - cat << EOF >> "$SITE_CONF" -SSTATE_DIR = "$SSTATE_DIR" -DL_DIR = "$DL_DIR" -EOF -fi diff --git a/scripts/ci/oe-selftest.sh b/scripts/ci/oe-selftest.sh deleted file mode 100755 index 3124cce..0000000 --- a/scripts/ci/oe-selftest.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# run meta-updater's oe-selftests - -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} - -( -set +euo pipefail -set +x -. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" - -oe-selftest -r updater -) -- cgit v1.2.3-54-g00ecf