diff options
author | lbonn <lbonn@users.noreply.github.com> | 2019-07-24 16:32:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 16:32:19 +0200 |
commit | 1e229a8747283d93eca0fc3c8ef90c52aca4187d (patch) | |
tree | 1e85f1c489bc49b9200ee2e634a3a02c6bfa7593 /scripts | |
parent | 7896e16972f8c76689d090ae36b5f580f0e8667a (diff) | |
parent | 383144042a1354a0d1e6d042e77bdb0faaba9ed2 (diff) | |
download | meta-updater-1e229a8747283d93eca0fc3c8ef90c52aca4187d.tar.gz |
Move `before_script` gitlab steps to `script` (#563)
Move `before_script` gitlab steps to `script`
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ci/configure.sh | 27 | ||||
-rw-r--r-- | scripts/ci/gitlab/docker.yml | 8 | ||||
-rw-r--r-- | scripts/ci/gitlab/tests.yml | 3 |
3 files changed, 27 insertions, 11 deletions
diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh index 67563ed..ae78f06 100755 --- a/scripts/ci/configure.sh +++ b/scripts/ci/configure.sh | |||
@@ -9,10 +9,16 @@ 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_REMOTE=${TEST_AKTUALIZR_REMOTE:-} | 11 | TEST_AKTUALIZR_REMOTE=${TEST_AKTUALIZR_REMOTE:-} |
12 | TEST_AKTUALIZR_TAG=${TEST_AKTUALIZR_TAG:-} | ||
12 | if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then | 13 | if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then |
13 | TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} | 14 | if [ -n "$TEST_AKTUALIZR_TAG" ]; then |
14 | TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} | 15 | TEST_AKTUALIZR_BRANCH="" |
15 | TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$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 | ||
16 | fi | 22 | fi |
17 | 23 | ||
18 | TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} | 24 | TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} |
@@ -43,12 +49,23 @@ EOF | |||
43 | 49 | ||
44 | if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then | 50 | if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then |
45 | echo ">> Set aktualizr branch in bitbake's config" | 51 | echo ">> Set aktualizr branch in bitbake's config" |
46 | cat << EOF >> "$SITE_CONF" | 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" | ||
47 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" | 63 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" |
48 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" | 64 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" |
49 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" | 65 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" |
50 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" | 66 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" |
51 | EOF | 67 | EOF |
68 | fi | ||
52 | fi | 69 | fi |
53 | 70 | ||
54 | if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then | 71 | if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then |
@@ -70,5 +87,5 @@ DL_DIR = "$DL_DIR" | |||
70 | EOF | 87 | EOF |
71 | fi | 88 | fi |
72 | 89 | ||
73 | echo -e ">> Final configuration (site.conf):\n" | 90 | echo -e ">> Final configuration (site.conf):\\n" |
74 | cat "$SITE_CONF" | 91 | cat "$SITE_CONF" |
diff --git a/scripts/ci/gitlab/docker.yml b/scripts/ci/gitlab/docker.yml index 5b81d77..ba488c6 100644 --- a/scripts/ci/gitlab/docker.yml +++ b/scripts/ci/gitlab/docker.yml | |||
@@ -10,9 +10,9 @@ | |||
10 | stage: docker | 10 | stage: docker |
11 | services: | 11 | services: |
12 | - docker:18-dind | 12 | - docker:18-dind |
13 | before_script: | ||
14 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | ||
15 | script: | 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 | 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 | 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" | 18 | - docker push "$BITBAKE_IMAGE" |
@@ -30,8 +30,8 @@ | |||
30 | stage: docker | 30 | stage: docker |
31 | services: | 31 | services: |
32 | - docker:18-dind | 32 | - docker:18-dind |
33 | before_script: | ||
34 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | ||
35 | script: | 33 | script: |
34 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | ||
35 | |||
36 | - docker pull "$BITBAKE_IMAGE" | 36 | - docker pull "$BITBAKE_IMAGE" |
37 | - docker pull "$BITBAKE_CHECKOUT_IMAGE" | 37 | - docker pull "$BITBAKE_CHECKOUT_IMAGE" |
diff --git a/scripts/ci/gitlab/tests.yml b/scripts/ci/gitlab/tests.yml index 4bd5844..4175412 100644 --- a/scripts/ci/gitlab/tests.yml +++ b/scripts/ci/gitlab/tests.yml | |||
@@ -24,10 +24,9 @@ | |||
24 | - bitbake | 24 | - bitbake |
25 | variables: | 25 | variables: |
26 | TEST_AKTUALIZR_CREDENTIALS: $CI_PROJECT_DIR/credentials.zip | 26 | TEST_AKTUALIZR_CREDENTIALS: $CI_PROJECT_DIR/credentials.zip |
27 | before_script: | 27 | script: |
28 | - aws s3 cp s3://ota-gitlab-ci/hereotaconnect_prod.zip credentials.zip | 28 | - aws s3 cp s3://ota-gitlab-ci/hereotaconnect_prod.zip credentials.zip |
29 | - sudo /usr/local/bin/setup_kvm.sh | 29 | - sudo /usr/local/bin/setup_kvm.sh |
30 | script: | ||
31 | - | | 30 | - | |
32 | # sg is needed after adding bitbake to the kvm group (see setup_kvm.sh) | 31 | # sg is needed after adding bitbake to the kvm group (see setup_kvm.sh) |
33 | sg kvm << EOS | 32 | sg kvm << EOS |