diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2020-02-28 13:59:08 +0100 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2020-02-28 13:59:08 +0100 |
commit | 21c526a80a722fef71cf22dc2ddcbf1ae89a39fd (patch) | |
tree | e7c8ff1c7f7b5d300095c32ba563646bb1d472fa | |
parent | 91bad00e3dbad8512937a898e5a86bf0f1f078c4 (diff) | |
download | meta-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.bitbake | 32 | ||||
-rwxr-xr-x | scripts/ci/build.sh | 3 | ||||
-rwxr-xr-x | scripts/ci/configure.sh | 40 | ||||
-rwxr-xr-x | scripts/ci/oe-selftest.sh | 2 |
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 @@ | |||
1 | FROM debian:stable | 1 | FROM debian:stretch |
2 | LABEL Description="Image for bitbaking" | 2 | LABEL Description="Image for bitbaking" |
3 | 3 | ||
4 | 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 | 4 | RUN 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 |
5 | 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 | 5 | RUN 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 |
6 | RUN apt-get update -q && apt-get install -qy \ | 6 | RUN 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 | ||
34 | ARG uid=1000 | 40 | ARG uid=4321 |
35 | ARG gid=1000 | 41 | ARG gid=4321 |
36 | RUN groupadd -g $gid bitbake | 42 | RUN groupadd -g $gid bitbake |
37 | RUN useradd -m -u $uid -g $gid bitbake | 43 | RUN useradd -m -u $uid -g $gid -s /bin/bash bitbake |
38 | 44 | ||
39 | RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen | 45 | RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen |
40 | ENV LC_ALL="en_US.UTF-8" | 46 | ENV LC_ALL="en_US.UTF-8" |
41 | ENV LANG="en_US.UTF-8" | 47 | ENV LANG="en_US.UTF-8" |
42 | ENV LANGUAGE="en_US.UTF-8" | 48 | ENV LANGUAGE="en_US.UTF-8" |
49 | |||
50 | # script to mirror kvm group id with host | ||
51 | RUN echo "bitbake ALL=NOPASSWD: /usr/local/bin/setup_kvm.sh" >> /etc/sudoers | ||
52 | COPY ./docker/setup_kvm.sh /usr/local/bin/setup_kvm.sh | ||
53 | |||
54 | # other ci scripts | ||
55 | RUN mkdir /scripts | ||
56 | COPY configure.sh build.sh oe-selftest.sh /scripts/ | ||
57 | |||
58 | USER "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 | ( |
13 | set +euo pipefail | 13 | set +euo pipefail |
14 | set +x | 14 | set +x |
15 | METADIR=$(realpath "$TEST_REPO_DIR") | ||
16 | export 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 | ||
19 | set -x | ||
17 | bitbake "${IMAGE_NAME}" | 20 | bitbake "${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} | |||
8 | TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} | 8 | TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} |
9 | TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} | 9 | TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} |
10 | 10 | ||
11 | TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} | 11 | TEST_AKTUALIZR_REMOTE=${TEST_AKTUALIZR_REMOTE:-} |
12 | TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} | 12 | TEST_AKTUALIZR_TAG=${TEST_AKTUALIZR_TAG:-} |
13 | TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} | 13 | if [ -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 | ||
22 | fi | ||
23 | |||
14 | TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} | 24 | TEST_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 | |||
21 | set +euo pipefail | 31 | set +euo pipefail |
22 | set +x | 32 | set +x |
23 | echo ">> Running envsetup.sh" | 33 | echo ">> Running envsetup.sh" |
34 | METADIR=$(realpath "$TEST_REPO_DIR") | ||
35 | export 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" | |||
31 | echo ">> Set common bitbake config options" | 43 | echo ">> Set common bitbake config options" |
32 | cat << EOF > "$SITE_CONF" | 44 | cat << EOF > "$SITE_CONF" |
33 | SANITY_TESTED_DISTROS = "" | 45 | SANITY_TESTED_DISTROS = "" |
34 | SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH" | ||
35 | IMAGE_FEATURES += "ssh-server-openssh" | 46 | IMAGE_FEATURES += "ssh-server-openssh" |
36 | 47 | ||
37 | EOF | 48 | EOF |
38 | 49 | ||
39 | echo ">> Set aktualizr branch in bitbake's config" | 50 | if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then |
40 | cat << 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" | ||
55 | SRCREV_pn-aktualizr = "" | ||
56 | SRCREV_pn-aktualizr-native = "" | ||
57 | BRANCH_pn-aktualizr = ";nobranch=1;tag=$TEST_AKTUALIZR_TAG" | ||
58 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" | ||
59 | EOF | ||
60 | else | ||
61 | # branch case | ||
62 | cat << EOF >> "$SITE_CONF" | ||
41 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" | 63 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" |
42 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" | 64 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" |
43 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" | 65 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" |
44 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" | 66 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" |
45 | |||
46 | EOF | 67 | EOF |
68 | fi | ||
69 | fi | ||
47 | 70 | ||
48 | if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then | 71 | if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then |
49 | echo ">> Set aktualizr credentials" | 72 | echo ">> Set aktualizr credentials" |
@@ -63,3 +86,6 @@ SSTATE_DIR = "$SSTATE_DIR" | |||
63 | DL_DIR = "$DL_DIR" | 86 | DL_DIR = "$DL_DIR" |
64 | EOF | 87 | EOF |
65 | fi | 88 | fi |
89 | |||
90 | echo -e ">> Final configuration (site.conf):\\n" | ||
91 | cat "$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 | ( |
13 | set +euo pipefail | 13 | set +euo pipefail |
14 | set +x | 14 | set +x |
15 | METADIR=$(realpath "$TEST_REPO_DIR") | ||
16 | export 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 | ||
17 | set -x | 19 | set -x |