summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLaurent Bonnans <laurent.bonnans@here.com>2018-06-26 15:53:00 +0200
committerLaurent Bonnans <laurent.bonnans@here.com>2018-09-06 11:45:07 +0200
commit7023fdda425f9d5e3b48e2cd12f961c0060ace54 (patch)
tree62c62ade104ff7f1eae67c75cb8f82f6c3931ae3 /scripts
parent0d3b28dac079df41132d4a80cc232105cde1bcc3 (diff)
downloadmeta-updater-7023fdda425f9d5e3b48e2cd12f961c0060ace54.tar.gz
Setup garage credentials for oe-selftest CI
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ci/Jenkinsfile.bleeding16
-rwxr-xr-xscripts/ci/configure.sh25
2 files changed, 23 insertions, 18 deletions
diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding
index aba7d39..f4d8883 100644
--- a/scripts/ci/Jenkinsfile.bleeding
+++ b/scripts/ci/Jenkinsfile.bleeding
@@ -56,27 +56,21 @@ pipeline {
56 ''' 56 '''
57 } 57 }
58 } 58 }
59 stage('build-core-image-minimal') { 59 stage('build-core-image-minimal+oe-selftest') {
60 agent { 60 agent {
61 dockerfile { 61 dockerfile {
62 filename 'scripts/ci/Dockerfile.bitbake' 62 filename 'scripts/ci/Dockerfile.bitbake'
63 args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' 63 args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common'
64 } 64 }
65 } 65 }
66 environment {
67 TEST_AKTUALIZR_CREDENTIALS = credentials('garage-credentials')
68 }
66 steps { 69 steps {
67 sh 'scripts/ci/configure.sh' 70 sh 'scripts/ci/configure.sh'
68 71
69 sh 'scripts/ci/build.sh core-image-minimal' 72 sh 'scripts/ci/build.sh core-image-minimal'
70 } 73
71 }
72 stage('oe-selftest') {
73 agent {
74 dockerfile {
75 filename 'scripts/ci/Dockerfile.bitbake'
76 args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common'
77 }
78 }
79 steps {
80 sh 'scripts/ci/oe-selftest.sh' 74 sh 'scripts/ci/oe-selftest.sh'
81 } 75 }
82 } 76 }
diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh
index 1e87a7b..960a0cc 100755
--- a/scripts/ci/configure.sh
+++ b/scripts/ci/configure.sh
@@ -6,27 +6,30 @@ set -x
6TEST_MACHINE=${TEST_MACHINE:-qemux86-64} 6TEST_MACHINE=${TEST_MACHINE:-qemux86-64}
7TEST_BUILD_DIR=${TEST_BUILD_DIR:-build} 7TEST_BUILD_DIR=${TEST_BUILD_DIR:-build}
8TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} 8TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo}
9TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-}
9 10
10TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} 11TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.}
11TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} 12TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master}
12TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} 13TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")}
13TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} 14TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-}
14 15
15# move existing conf directory to backup, before generating a new one 16# move existing conf directory to backup, before generating a new one
16rm -rf "${TEST_BUILD_DIR}/conf.old" || true 17rm -rf "$TEST_BUILD_DIR/conf.old" || true
17mv "${TEST_BUILD_DIR}/conf" "${TEST_BUILD_DIR}/conf.old" || true 18mv "$TEST_BUILD_DIR/conf" "$TEST_BUILD_DIR/conf.old" || true
18 19
19( 20(
20set +euo pipefail 21set +euo pipefail
21set +x 22set +x
22echo ">> Running envsetup.sh" 23echo ">> Running envsetup.sh"
23. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" 24. "$TEST_REPO_DIR/meta-updater/scripts/envsetup.sh" "$TEST_MACHINE" "$TEST_BUILD_DIR"
24) 25)
25 26
26set +x 27set +x
27 28
29SITE_CONF="$TEST_BUILD_DIR/conf/site.conf"
30
28echo ">> Set common bitbake config options" 31echo ">> Set common bitbake config options"
29cat << EOF > "${TEST_BUILD_DIR}/conf/site.conf" 32cat << EOF > "$SITE_CONF"
30SANITY_TESTED_DISTROS = "" 33SANITY_TESTED_DISTROS = ""
31SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH" 34SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH"
32IMAGE_FEATURES += "ssh-server-openssh" 35IMAGE_FEATURES += "ssh-server-openssh"
@@ -34,7 +37,7 @@ IMAGE_FEATURES += "ssh-server-openssh"
34EOF 37EOF
35 38
36echo ">> Set aktualizr branch in bitbake's config" 39echo ">> Set aktualizr branch in bitbake's config"
37cat << EOF >> "${TEST_BUILD_DIR}/conf/site.conf" 40cat << EOF >> "$SITE_CONF"
38SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" 41SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV"
39SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" 42SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}"
40BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" 43BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH"
@@ -42,12 +45,20 @@ BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}"
42 45
43EOF 46EOF
44 47
48if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then
49 echo ">> Set aktualizr credentials"
50 cat << EOF >> "$SITE_CONF"
51SOTA_PACKED_CREDENTIALS = "$TEST_AKTUALIZR_CREDENTIALS"
52EOF
53fi
54
45if [[ -n $TEST_BITBAKE_COMMON_DIR ]]; then 55if [[ -n $TEST_BITBAKE_COMMON_DIR ]]; then
46 echo ">> Set caching" 56 echo ">> Set caching"
47 SSTATE_DIR="$TEST_BITBAKE_COMMON_DIR/sstate-cache" 57 SSTATE_DIR="$TEST_BITBAKE_COMMON_DIR/sstate-cache"
48 DL_DIR="$TEST_BITBAKE_COMMON_DIR/downloads" 58 DL_DIR="$TEST_BITBAKE_COMMON_DIR/downloads"
49 mkdir -p "$SSTATE_DIR" "$DL_DIR" 59 mkdir -p "$SSTATE_DIR" "$DL_DIR"
50 cat << EOF >> "${TEST_BUILD_DIR}/conf/site.conf" 60
61 cat << EOF >> "$SITE_CONF"
51SSTATE_DIR = "$SSTATE_DIR" 62SSTATE_DIR = "$SSTATE_DIR"
52DL_DIR = "$DL_DIR" 63DL_DIR = "$DL_DIR"
53EOF 64EOF