summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2020-02-28 13:59:08 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2020-02-28 13:59:08 +0100
commit21c526a80a722fef71cf22dc2ddcbf1ae89a39fd (patch)
treee7c8ff1c7f7b5d300095c32ba563646bb1d472fa
parent91bad00e3dbad8512937a898e5a86bf0f1f078c4 (diff)
downloadmeta-updater-21c526a80a722fef71cf22dc2ddcbf1ae89a39fd.tar.gz
Update CI scripts to match other supported branches.
This seems mostly related to 9eebc8d15a297d68fc35dd4d77fcb945d2f395b2, which didn't make it to thud, since some of it was only required for master. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
-rw-r--r--scripts/ci/Dockerfile.bitbake32
-rwxr-xr-xscripts/ci/build.sh3
-rwxr-xr-xscripts/ci/configure.sh40
-rwxr-xr-xscripts/ci/oe-selftest.sh2
4 files changed, 62 insertions, 15 deletions
diff --git a/scripts/ci/Dockerfile.bitbake b/scripts/ci/Dockerfile.bitbake
index c91f94c..51eaa57 100644
--- a/scripts/ci/Dockerfile.bitbake
+++ b/scripts/ci/Dockerfile.bitbake
@@ -1,15 +1,17 @@
1FROM debian:stable 1FROM debian:stretch
2LABEL Description="Image for bitbaking" 2LABEL Description="Image for bitbaking"
3 3
4RUN 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 4RUN sed -i 's#deb http://deb.debian.org/debian stretch main#deb http://deb.debian.org/debian stretch main contrib#g' /etc/apt/sources.list
5RUN 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 5RUN sed -i 's#deb http://deb.debian.org/debian stretch-updates main#deb http://deb.debian.org/debian stretch-updates main contrib#g' /etc/apt/sources.list
6RUN apt-get update -q && apt-get install -qy \ 6RUN apt-get update -q && apt-get install --no-install-suggests --no-install-recommends -qy \
7 awscli \
7 build-essential \ 8 build-essential \
8 bzip2 \ 9 bzip2 \
9 chrpath \ 10 chrpath \
10 cpio \ 11 cpio \
11 default-jre \ 12 default-jre \
12 diffstat \ 13 diffstat \
14 file \
13 gawk \ 15 gawk \
14 gcc-multilib \ 16 gcc-multilib \
15 git-core \ 17 git-core \
@@ -17,26 +19,40 @@ RUN apt-get update -q && apt-get install -qy \
17 iproute \ 19 iproute \
18 libpython-dev \ 20 libpython-dev \
19 libsdl1.2-dev \ 21 libsdl1.2-dev \
22 libvirt-clients \
23 libvirt-daemon-system \
20 locales \ 24 locales \
21 ovmf \ 25 ovmf \
26 openssh-client \
22 procps \ 27 procps \
23 python \ 28 python \
24 python3 \ 29 python3 \
25 python3-pexpect \ 30 python3-pexpect \
26 qemu \ 31 qemu-kvm \
27 socat \ 32 socat \
33 sudo \
28 texinfo \ 34 texinfo \
29 unzip \ 35 unzip \
30 wget \ 36 wget \
31 xterm \ 37 xterm \
32 xz-utils 38 xz-utils
33 39
34ARG uid=1000 40ARG uid=4321
35ARG gid=1000 41ARG gid=4321
36RUN groupadd -g $gid bitbake 42RUN groupadd -g $gid bitbake
37RUN useradd -m -u $uid -g $gid bitbake 43RUN useradd -m -u $uid -g $gid -s /bin/bash bitbake
38 44
39RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen 45RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
40ENV LC_ALL="en_US.UTF-8" 46ENV LC_ALL="en_US.UTF-8"
41ENV LANG="en_US.UTF-8" 47ENV LANG="en_US.UTF-8"
42ENV LANGUAGE="en_US.UTF-8" 48ENV LANGUAGE="en_US.UTF-8"
49
50# script to mirror kvm group id with host
51RUN echo "bitbake ALL=NOPASSWD: /usr/local/bin/setup_kvm.sh" >> /etc/sudoers
52COPY ./docker/setup_kvm.sh /usr/local/bin/setup_kvm.sh
53
54# other ci scripts
55RUN mkdir /scripts
56COPY configure.sh build.sh oe-selftest.sh /scripts/
57
58USER "bitbake"
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
index 6235428..9fbae98 100755
--- a/scripts/ci/build.sh
+++ b/scripts/ci/build.sh
@@ -12,7 +12,10 @@ IMAGE_NAME=${1:-core-image-minimal}
12( 12(
13set +euo pipefail 13set +euo pipefail
14set +x 14set +x
15METADIR=$(realpath "$TEST_REPO_DIR")
16export METADIR
15. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" 17. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}"
16 18
19set -x
17bitbake "${IMAGE_NAME}" 20bitbake "${IMAGE_NAME}"
18) 21)
diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh
index 960a0cc..ae78f06 100755
--- a/scripts/ci/configure.sh
+++ b/scripts/ci/configure.sh
@@ -8,9 +8,19 @@ TEST_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:-} 9TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-}
10 10
11TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} 11TEST_AKTUALIZR_REMOTE=${TEST_AKTUALIZR_REMOTE:-}
12TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} 12TEST_AKTUALIZR_TAG=${TEST_AKTUALIZR_TAG:-}
13TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} 13if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then
14 if [ -n "$TEST_AKTUALIZR_TAG" ]; then
15 TEST_AKTUALIZR_BRANCH=""
16 TEST_AKTUALIZR_REV=""
17 else
18 TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.}
19 TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master}
20 TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")}
21 fi
22fi
23
14TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} 24TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-}
15 25
16# move existing conf directory to backup, before generating a new one 26# move existing conf directory to backup, before generating a new one
@@ -21,6 +31,8 @@ mv "$TEST_BUILD_DIR/conf" "$TEST_BUILD_DIR/conf.old" || true
21set +euo pipefail 31set +euo pipefail
22set +x 32set +x
23echo ">> Running envsetup.sh" 33echo ">> Running envsetup.sh"
34METADIR=$(realpath "$TEST_REPO_DIR")
35export METADIR
24. "$TEST_REPO_DIR/meta-updater/scripts/envsetup.sh" "$TEST_MACHINE" "$TEST_BUILD_DIR" 36. "$TEST_REPO_DIR/meta-updater/scripts/envsetup.sh" "$TEST_MACHINE" "$TEST_BUILD_DIR"
25) 37)
26 38
@@ -31,19 +43,30 @@ SITE_CONF="$TEST_BUILD_DIR/conf/site.conf"
31echo ">> Set common bitbake config options" 43echo ">> Set common bitbake config options"
32cat << EOF > "$SITE_CONF" 44cat << EOF > "$SITE_CONF"
33SANITY_TESTED_DISTROS = "" 45SANITY_TESTED_DISTROS = ""
34SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH"
35IMAGE_FEATURES += "ssh-server-openssh" 46IMAGE_FEATURES += "ssh-server-openssh"
36 47
37EOF 48EOF
38 49
39echo ">> Set aktualizr branch in bitbake's config" 50if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then
40cat << EOF >> "$SITE_CONF" 51 echo ">> Set aktualizr branch in bitbake's config"
52 if [ -n "$TEST_AKTUALIZR_TAG" ]; then
53 # tag case
54 cat << EOF >> "$SITE_CONF"
55SRCREV_pn-aktualizr = ""
56SRCREV_pn-aktualizr-native = ""
57BRANCH_pn-aktualizr = ";nobranch=1;tag=$TEST_AKTUALIZR_TAG"
58BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}"
59EOF
60 else
61 # branch case
62 cat << EOF >> "$SITE_CONF"
41SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" 63SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV"
42SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" 64SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}"
43BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" 65BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH"
44BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" 66BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}"
45
46EOF 67EOF
68 fi
69fi
47 70
48if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then 71if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then
49 echo ">> Set aktualizr credentials" 72 echo ">> Set aktualizr credentials"
@@ -63,3 +86,6 @@ SSTATE_DIR = "$SSTATE_DIR"
63DL_DIR = "$DL_DIR" 86DL_DIR = "$DL_DIR"
64EOF 87EOF
65fi 88fi
89
90echo -e ">> Final configuration (site.conf):\\n"
91cat "$SITE_CONF"
diff --git a/scripts/ci/oe-selftest.sh b/scripts/ci/oe-selftest.sh
index 5f0f0d0..d441d02 100755
--- a/scripts/ci/oe-selftest.sh
+++ b/scripts/ci/oe-selftest.sh
@@ -12,6 +12,8 @@ TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo}
12( 12(
13set +euo pipefail 13set +euo pipefail
14set +x 14set +x
15METADIR=$(realpath "$TEST_REPO_DIR")
16export METADIR
15. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" 17. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}"
16 18
17set -x 19set -x