diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/ci/Dockerfile.checkout | 13 | ||||
-rwxr-xr-x | scripts/ci/checkout-oe.sh | 76 | ||||
-rwxr-xr-x | scripts/ci/docker/setup_kvm.sh | 14 | ||||
-rw-r--r-- | scripts/ci/gitlab/checkout.yml | 16 | ||||
-rw-r--r-- | scripts/ci/gitlab/docker.yml | 37 | ||||
-rw-r--r-- | scripts/ci/gitlab/tests.yml | 35 |
6 files changed, 0 insertions, 191 deletions
diff --git a/scripts/ci/Dockerfile.checkout b/scripts/ci/Dockerfile.checkout deleted file mode 100644 index 5210c6b..0000000 --- a/scripts/ci/Dockerfile.checkout +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | FROM debian:stretch-slim | ||
2 | LABEL Description="Image for checking out updater-repo" | ||
3 | |||
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 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 \ | ||
7 | git \ | ||
8 | repo \ | ||
9 | xmlstarlet | ||
10 | |||
11 | # checkout script | ||
12 | RUN mkdir /scripts | ||
13 | COPY checkout-oe.sh /scripts/ | ||
diff --git a/scripts/ci/checkout-oe.sh b/scripts/ci/checkout-oe.sh deleted file mode 100755 index fdc0e48..0000000 --- a/scripts/ci/checkout-oe.sh +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | set -euo pipefail | ||
4 | |||
5 | set -x | ||
6 | |||
7 | REMOTE_SOURCE=${REMOTE_SOURCE:-https://github.com/advancedtelematic} | ||
8 | MANIFEST=${MANIFEST:-master} | ||
9 | CURRENT_PROJECT=${CURRENT_PROJECT:-} | ||
10 | |||
11 | # list of projects to pin to one version in the format: | ||
12 | # "project:rev;project2:rev2..." | ||
13 | PIN_LIST=${PIN_LIST:-} | ||
14 | |||
15 | #CURRENT_REV=$(git rev-parse HEAD) | ||
16 | LOCAL_REPO=$PWD | ||
17 | |||
18 | mkdir -p updater-repo | ||
19 | |||
20 | cd updater-repo | ||
21 | |||
22 | if [ -d .repo/manifests ]; then | ||
23 | git -C .repo/manifests reset --hard | ||
24 | fi | ||
25 | |||
26 | repo init -m "${MANIFEST}.xml" -u "$REMOTE_SOURCE/updater-repo" | ||
27 | |||
28 | # patch manifest: | ||
29 | # - add a new "ats" remote that points to "$REMOTE_SOURCE" | ||
30 | # - change projects that contain "advancedtelematic" to use the ats remote | ||
31 | MANIFEST_FILE=".repo/manifests/${MANIFEST}.xml" | ||
32 | xmlstarlet ed --omit-decl -L \ | ||
33 | -s "/manifest" -t elem -n "remote" -v "" \ | ||
34 | -i "/manifest/remote[last()]" -t attr -n "name" -v "ats" \ | ||
35 | -i "/manifest/remote[last()]" -t attr -n "fetch" -v "$REMOTE_SOURCE" \ | ||
36 | -d "/manifest/project[contains(@name, 'advancedtelematic')]/@remote" \ | ||
37 | -i "/manifest/project[contains(@name, 'advancedtelematic')]" -t attr -n "remote" -v "ats" \ | ||
38 | "$MANIFEST_FILE" | ||
39 | |||
40 | # hack: sed on `advancedtelematic/` names, to remove this unwanted prefix | ||
41 | sed -i 's#name="advancedtelematic/#name="#g' "$MANIFEST_FILE" | ||
42 | |||
43 | # pin projects from the list | ||
44 | ( | ||
45 | IFS=";" | ||
46 | for pin in $PIN_LIST; do | ||
47 | IFS=":" | ||
48 | read -r project rev <<< "$pin" | ||
49 | xmlstarlet ed --omit-decl -L \ | ||
50 | -d "/manifest/project[@name=\"$project\"]/@revision" \ | ||
51 | -i "/manifest/project[@name=\"$project\"]/@revision" -t attr -n "revision" -v "$rev" \ | ||
52 | -i "/manifest/project[@name=\"$project\"]" -t attr -n "revision" -v "$rev" \ | ||
53 | "$MANIFEST_FILE" | ||
54 | IFS=";" | ||
55 | done | ||
56 | ) | ||
57 | |||
58 | # Remove the current project from the manifest if we have it checked out | ||
59 | if [ -n "$CURRENT_PROJECT" ]; then | ||
60 | xmlstarlet ed --omit-decl -L \ | ||
61 | -d "/manifest/project[@name=\"$CURRENT_PROJECT\"]" \ | ||
62 | "$MANIFEST_FILE" | ||
63 | fi | ||
64 | |||
65 | repo manifest | ||
66 | |||
67 | repo forall -c 'git reset --hard ; git clean -fdx' | ||
68 | |||
69 | repo sync -d --force-sync | ||
70 | |||
71 | if [ -n "$CURRENT_PROJECT" ]; then | ||
72 | rm -f "$CURRENT_PROJECT" | ||
73 | ln -s "$LOCAL_REPO" "$CURRENT_PROJECT" | ||
74 | fi | ||
75 | |||
76 | repo manifest -r | ||
diff --git a/scripts/ci/docker/setup_kvm.sh b/scripts/ci/docker/setup_kvm.sh deleted file mode 100755 index 1ffbbf5..0000000 --- a/scripts/ci/docker/setup_kvm.sh +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # This script makes the gid of the 'kvm' group to match the group | ||
4 | # owner of '/dev/kvm' | ||
5 | # | ||
6 | # These two are not guaranteed to match when a docker image starts | ||
7 | # with access to '/dev/kvm' that comes from the host | ||
8 | |||
9 | set -euo pipefail | ||
10 | |||
11 | kvm_gid=$(stat -c "%g" /dev/kvm) | ||
12 | groupmod -g "$kvm_gid" kvm | ||
13 | usermod -a -G kvm bitbake | ||
14 | ln -s /bin/true /usr/bin/kvm-ok | ||
diff --git a/scripts/ci/gitlab/checkout.yml b/scripts/ci/gitlab/checkout.yml deleted file mode 100644 index 28c9177..0000000 --- a/scripts/ci/gitlab/checkout.yml +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | .bb_checkout: | ||
2 | # parameters: | ||
3 | # - MANIFEST | ||
4 | # - REMOTE_SOURCE | ||
5 | # - CURRENT_PROJECT (will be symlinked instead of pulled) | ||
6 | |||
7 | image: $BITBAKE_CHECKOUT_IMAGE | ||
8 | cache: | ||
9 | paths: | ||
10 | - updater-repo | ||
11 | artifacts: | ||
12 | expire_in: "1 day" | ||
13 | paths: | ||
14 | - updater-repo | ||
15 | script: | ||
16 | - /scripts/checkout-oe.sh | ||
diff --git a/scripts/ci/gitlab/docker.yml b/scripts/ci/gitlab/docker.yml deleted file mode 100644 index ba488c6..0000000 --- a/scripts/ci/gitlab/docker.yml +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | .bb_docker_local: | ||
2 | # intended to be run on meta-updater's master branch which contains the | ||
3 | # reference docker files | ||
4 | # parameters: | ||
5 | # - BITBAKE_IMAGE | ||
6 | # - BITBAKE_CHECKOUT_IMAGE | ||
7 | # - BITBKAE_IMAGE_MASTER | ||
8 | # - BITBAKE_CHECKOUT_IMAGE_MASTER | ||
9 | image: docker:18 | ||
10 | stage: docker | ||
11 | services: | ||
12 | - docker:18-dind | ||
13 | script: | ||
14 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | ||
15 | |||
16 | - docker pull "$BITBAKE_IMAGE" || docker pull "$BITBKAE_IMAGE_MASTER" || true | ||
17 | - docker build --pull --cache-from "$BITBKAE_IMAGE_MASTER" --cache-from "$BITBAKE_IMAGE" -f ./scripts/ci/Dockerfile.bitbake -t "$BITBAKE_IMAGE" ./scripts/ci | ||
18 | - docker push "$BITBAKE_IMAGE" | ||
19 | |||
20 | - docker pull "$BITBAKE_CHECKOUT_IMAGE" || docker pull "$BITBAKE_CHECKOUT_IMAGE_MASTER" || true | ||
21 | - docker build --pull --cache-from "$BITBAKE_CHECKOUT_IMAGE_MASTER" --cache-from "$BITBAKE_CHECKOUT_IMAGE" -f ./scripts/ci/Dockerfile.checkout -t "$BITBAKE_CHECKOUT_IMAGE" ./scripts/ci | ||
22 | - docker push "$BITBAKE_CHECKOUT_IMAGE" | ||
23 | |||
24 | .bb_docker_remote: | ||
25 | # intended to be run on other branches and repos: just pulls the last master image | ||
26 | # parameters: | ||
27 | # - BITBAKE_IMAGE | ||
28 | # - BITBAKE_CHECKOUT_IMAGE | ||
29 | image: docker:18 | ||
30 | stage: docker | ||
31 | services: | ||
32 | - docker:18-dind | ||
33 | script: | ||
34 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | ||
35 | |||
36 | - docker pull "$BITBAKE_IMAGE" | ||
37 | - docker pull "$BITBAKE_CHECKOUT_IMAGE" | ||
diff --git a/scripts/ci/gitlab/tests.yml b/scripts/ci/gitlab/tests.yml deleted file mode 100644 index 4175412..0000000 --- a/scripts/ci/gitlab/tests.yml +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | .bitbake: | ||
2 | # parameters: | ||
3 | # - TEST_BUILD_DIR | ||
4 | # - TEST_MACHINE (defaults to qemux86-64) | ||
5 | # - BITBAKE_TARGETS | ||
6 | image: $BITBAKE_IMAGE | ||
7 | dependencies: | ||
8 | - Checkout | ||
9 | tags: | ||
10 | - bitbake | ||
11 | script: | ||
12 | - /scripts/configure.sh | ||
13 | - /scripts/build.sh $BITBAKE_TARGETS | ||
14 | |||
15 | .oe-selftest: | ||
16 | # parameters: | ||
17 | # - TEST_BUILD_DIR | ||
18 | # - TEST_MACHINE (defaults to qemux86-64) | ||
19 | # - OE_SELFTESTS | ||
20 | image: $BITBAKE_IMAGE | ||
21 | dependencies: | ||
22 | - Checkout | ||
23 | tags: | ||
24 | - bitbake | ||
25 | variables: | ||
26 | TEST_AKTUALIZR_CREDENTIALS: $CI_PROJECT_DIR/credentials.zip | ||
27 | script: | ||
28 | - aws s3 cp s3://ota-gitlab-ci/hereotaconnect_prod.zip credentials.zip | ||
29 | - sudo /usr/local/bin/setup_kvm.sh | ||
30 | - | | ||
31 | # sg is needed after adding bitbake to the kvm group (see setup_kvm.sh) | ||
32 | sg kvm << EOS | ||
33 | /scripts/configure.sh | ||
34 | /scripts/oe-selftest.sh $OE_SELFTESTS | ||
35 | EOS | ||