summaryrefslogtreecommitdiffstats
path: root/scripts/ci/configure.sh
diff options
context:
space:
mode:
authorlbonn <lbonn@users.noreply.github.com>2018-06-19 10:53:32 +0200
committerGitHub <noreply@github.com>2018-06-19 10:53:32 +0200
commit2ca1b16a0910ec4890c504ce01e54161038a03e4 (patch)
treeb709a5a9239806a744bcca38b200960e471921fe /scripts/ci/configure.sh
parent46a3601acbda26e2fdeb3a3daf337887e757742c (diff)
parent8d021e159daf094d6056654a1ff5957353357163 (diff)
downloadmeta-updater-2ca1b16a0910ec4890c504ce01e54161038a03e4.tar.gz
Merge pull request #344 from advancedtelematic/test/ci-jenkins
First pipeline setup for meta-updater CI
Diffstat (limited to 'scripts/ci/configure.sh')
-rwxr-xr-xscripts/ci/configure.sh33
1 files changed, 33 insertions, 0 deletions
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 @@
1#!/bin/bash
2
3set -euo pipefail
4set -x
5
6TEST_MACHINE=${TEST_MACHINE:-qemux86-64}
7TEST_BUILD_DIR=${TEST_BUILD_DIR:-build}
8TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo}
9
10TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.}
11TEST_LOCAL_CONF_APPEND=${TEST_LOCAL_CONF_APPEND:-}
12TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master}
13TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="${TEST_AKTUALIZR_DIR}/.git" git rev-parse "${TEST_AKTUALIZR_BRANCH}")}
14
15# remove existing local.conf, keep
16rm -rf "${TEST_BUILD_DIR}/conf.old" || true
17mv "${TEST_BUILD_DIR}/conf" "${TEST_BUILD_DIR}/conf.old" || true
18
19(
20set +euo pipefail
21set +x
22echo ">> Running envsetup.sh"
23. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}"
24)
25
26if [[ -n $TEST_LOCAL_CONF_APPEND ]]; then
27 echo ">> Appending to local.conf"
28 REMOTE_AKTUALIZR_BRANCH=$(sed 's#^[^/]*/##g' <<< "$TEST_AKTUALIZR_BRANCH")
29 cat "$TEST_LOCAL_CONF_APPEND" | \
30 sed "s/\$<rev-sha1>/$TEST_AKTUALIZR_REV/g" | \
31 sed "s/\$<rev-branch>/$REMOTE_AKTUALIZR_BRANCH/g" \
32 >> "${TEST_BUILD_DIR}/conf/local.conf"
33fi