diff options
author | lbonn <lbonn@users.noreply.github.com> | 2019-07-23 12:48:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-23 12:48:22 +0200 |
commit | 7530d93ebb97b519a12b88d121320ac0bb711c46 (patch) | |
tree | c308d046b3e2c1d6cfbc55c83fd01f1c7abe66cf | |
parent | 311e5199c4f7cb73e393d751fede4ed86d358c02 (diff) | |
parent | 82308b9f8f1509d77330e70e162a1b066ad85e34 (diff) | |
download | meta-updater-7530d93ebb97b519a12b88d121320ac0bb711c46.tar.gz |
Output site.conf during CI configure step (#560)
Output site.conf during CI configure step
-rw-r--r-- | scripts/ci/Jenkinsfile.bleeding | 87 | ||||
-rw-r--r-- | scripts/ci/Jenkinsfile.bleeding-selftest | 91 | ||||
-rw-r--r-- | scripts/ci/README.adoc | 14 | ||||
-rwxr-xr-x | scripts/ci/configure.sh | 3 | ||||
-rw-r--r-- | scripts/ci/gitlab/docker.yml | 8 |
5 files changed, 7 insertions, 196 deletions
diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding deleted file mode 100644 index 6d340fd..0000000 --- a/scripts/ci/Jenkinsfile.bleeding +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | // This CI setup checks out aktualizr, meta-updater and updater-repo and builds | ||
2 | // master branches whenever a change is pushed to any of these | ||
3 | |||
4 | // define these for docker image creation | ||
5 | node { | ||
6 | // might cause some problems: | ||
7 | // https://stackoverflow.com/questions/44805076/setting-build-args-for-dockerfile-agent-using-a-jenkins-declarative-pipeline | ||
8 | JENKINS_UID = sh(returnStdout: true, script: 'id -u').trim() | ||
9 | JENKINS_GID = sh(returnStdout: true, script: 'id -g').trim() | ||
10 | } | ||
11 | |||
12 | pipeline { | ||
13 | agent any | ||
14 | environment { | ||
15 | TEST_AKTUALIZR_REMOTE = 'aktualizr' | ||
16 | TEST_AKTUALIZR_DIR = 'aktualizr' | ||
17 | TEST_AKTUALIZR_BRANCH = 'master' | ||
18 | TEST_BITBAKE_COMMON_DIR = "/opt/jenkins/bitbake-common" | ||
19 | } | ||
20 | stages { | ||
21 | stage('checkout') { | ||
22 | steps { | ||
23 | |||
24 | checkout([$class: 'GitSCM', | ||
25 | userRemoteConfigs: [ | ||
26 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] | ||
27 | ], | ||
28 | branches: [[name: 'refs/heads/master']], | ||
29 | extensions: [ | ||
30 | [$class: 'DisableRemotePoll'], | ||
31 | [$class: 'PruneStaleBranch'], | ||
32 | [$class: 'RelativeTargetDirectory', | ||
33 | relativeTargetDir: 'aktualizr' | ||
34 | ] | ||
35 | ], | ||
36 | ]) | ||
37 | |||
38 | checkout([$class: 'RepoScm', | ||
39 | manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', | ||
40 | manifestBranch: null, | ||
41 | manifestFile: 'master.xml', | ||
42 | manifestGroup: null, | ||
43 | mirrorDir: null, | ||
44 | jobs: 0, | ||
45 | depth: 0, | ||
46 | localManifest: null, | ||
47 | destinationDir: 'updater-repo', | ||
48 | repoUrl: null, | ||
49 | currentBranch: false, | ||
50 | resetFirst: true, | ||
51 | quiet: false, | ||
52 | trace: false, | ||
53 | showAllChanges: false, | ||
54 | ]) | ||
55 | |||
56 | // ignore bitbake build directories in docker | ||
57 | sh 'echo \'build*\' > .dockerignore' | ||
58 | |||
59 | // override meta-updater commit with currently tested branch | ||
60 | sh ''' | ||
61 | META_UPDATER_COMMIT=$(git rev-parse HEAD) | ||
62 | cd updater-repo/meta-updater | ||
63 | git checkout $META_UPDATER_COMMIT | ||
64 | ''' | ||
65 | } | ||
66 | } | ||
67 | stage('build-core-image-minimal') { | ||
68 | agent { | ||
69 | dockerfile { | ||
70 | filename 'scripts/ci/Dockerfile.bitbake' | ||
71 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' | ||
72 | additionalBuildArgs "--build-arg uid=${JENKINS_UID} --build-arg gid=${JENKINS_GID}" | ||
73 | reuseNode true | ||
74 | } | ||
75 | } | ||
76 | environment { | ||
77 | TEST_AKTUALIZR_CREDENTIALS = credentials('garage-credentials') | ||
78 | } | ||
79 | steps { | ||
80 | sh 'scripts/ci/configure.sh' | ||
81 | |||
82 | sh 'scripts/ci/build.sh core-image-minimal' | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | // vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: | ||
diff --git a/scripts/ci/Jenkinsfile.bleeding-selftest b/scripts/ci/Jenkinsfile.bleeding-selftest deleted file mode 100644 index 8c2d1de..0000000 --- a/scripts/ci/Jenkinsfile.bleeding-selftest +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | // This CI setup checks out aktualizr, meta-updater and updater-repo and builds | ||
2 | // master branches whenever a change is pushed to any of these | ||
3 | |||
4 | // define these for docker image creation | ||
5 | node { | ||
6 | // might cause some problems: | ||
7 | // https://stackoverflow.com/questions/44805076/setting-build-args-for-dockerfile-agent-using-a-jenkins-declarative-pipeline | ||
8 | JENKINS_UID = sh(returnStdout: true, script: 'id -u').trim() | ||
9 | JENKINS_GID = sh(returnStdout: true, script: 'id -g').trim() | ||
10 | } | ||
11 | |||
12 | pipeline { | ||
13 | agent { | ||
14 | node { label 'bitbake' } | ||
15 | } | ||
16 | environment { | ||
17 | TEST_AKTUALIZR_REMOTE = 'aktualizr' | ||
18 | TEST_AKTUALIZR_DIR = 'aktualizr' | ||
19 | TEST_AKTUALIZR_BRANCH = 'master' | ||
20 | TEST_BITBAKE_COMMON_DIR = "/opt/jenkins/bitbake-common" | ||
21 | } | ||
22 | stages { | ||
23 | stage('checkout') { | ||
24 | steps { | ||
25 | |||
26 | checkout([$class: 'GitSCM', | ||
27 | userRemoteConfigs: [ | ||
28 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] | ||
29 | ], | ||
30 | branches: [[name: 'refs/heads/master']], | ||
31 | extensions: [ | ||
32 | [$class: 'DisableRemotePoll'], | ||
33 | [$class: 'PruneStaleBranch'], | ||
34 | [$class: 'RelativeTargetDirectory', | ||
35 | relativeTargetDir: 'aktualizr' | ||
36 | ] | ||
37 | ], | ||
38 | ]) | ||
39 | |||
40 | checkout([$class: 'RepoScm', | ||
41 | manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', | ||
42 | manifestBranch: null, | ||
43 | manifestFile: 'master.xml', | ||
44 | manifestGroup: null, | ||
45 | mirrorDir: null, | ||
46 | jobs: 0, | ||
47 | depth: 0, | ||
48 | localManifest: null, | ||
49 | destinationDir: 'updater-repo', | ||
50 | repoUrl: null, | ||
51 | currentBranch: false, | ||
52 | resetFirst: true, | ||
53 | quiet: false, | ||
54 | trace: false, | ||
55 | showAllChanges: false, | ||
56 | ]) | ||
57 | |||
58 | // ignore bitbake build directories in docker | ||
59 | sh 'echo \'build*\' > .dockerignore' | ||
60 | |||
61 | // override meta-updater commit with currently tested branch | ||
62 | sh ''' | ||
63 | META_UPDATER_COMMIT=$(git rev-parse HEAD) | ||
64 | cd updater-repo/meta-updater | ||
65 | git checkout $META_UPDATER_COMMIT | ||
66 | ''' | ||
67 | } | ||
68 | } | ||
69 | stage('build-core-image-minimal+oe-selftest') { | ||
70 | agent { | ||
71 | dockerfile { | ||
72 | filename 'scripts/ci/Dockerfile.bitbake' | ||
73 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' | ||
74 | additionalBuildArgs "--build-arg uid=${JENKINS_UID} --build-arg gid=${JENKINS_GID}" | ||
75 | reuseNode true | ||
76 | } | ||
77 | } | ||
78 | environment { | ||
79 | TEST_AKTUALIZR_CREDENTIALS = credentials('garage-credentials') | ||
80 | } | ||
81 | steps { | ||
82 | sh 'scripts/ci/configure.sh' | ||
83 | |||
84 | sh 'scripts/ci/build.sh core-image-minimal' | ||
85 | |||
86 | sh 'scripts/ci/oe-selftest.sh' | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | // vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: | ||
diff --git a/scripts/ci/README.adoc b/scripts/ci/README.adoc deleted file mode 100644 index 222982b..0000000 --- a/scripts/ci/README.adoc +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | = Jenkins setup for running meta-updater CI | ||
2 | |||
3 | As bitbake is quite resource-hungry, there are some special steps that are | ||
4 | needed to run Jenkins CI tasks: | ||
5 | |||
6 | - docker should be installed and the `jenkins` unix user should belong to | ||
7 | the `docker` group | ||
8 | - `/opt/jenkins` should exist and have `jenkins:jenkins` permissions, it | ||
9 | will be mapped as a volume on the same location in the docker build | ||
10 | container | ||
11 | |||
12 | Note that for nodes running Jenkins slaves as a docker container, the | ||
13 | `/opt/jenkins` directory must exist on the host system as well, with | ||
14 | permissions matching the user and groupd ids in Jenkins' docker | ||
diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh index a8968da..67563ed 100755 --- a/scripts/ci/configure.sh +++ b/scripts/ci/configure.sh | |||
@@ -69,3 +69,6 @@ SSTATE_DIR = "$SSTATE_DIR" | |||
69 | DL_DIR = "$DL_DIR" | 69 | DL_DIR = "$DL_DIR" |
70 | EOF | 70 | EOF |
71 | fi | 71 | fi |
72 | |||
73 | echo -e ">> Final configuration (site.conf):\n" | ||
74 | cat "$SITE_CONF" | ||
diff --git a/scripts/ci/gitlab/docker.yml b/scripts/ci/gitlab/docker.yml index 827bb47..5b81d77 100644 --- a/scripts/ci/gitlab/docker.yml +++ b/scripts/ci/gitlab/docker.yml | |||
@@ -6,10 +6,10 @@ | |||
6 | # - BITBAKE_CHECKOUT_IMAGE | 6 | # - BITBAKE_CHECKOUT_IMAGE |
7 | # - BITBKAE_IMAGE_MASTER | 7 | # - BITBKAE_IMAGE_MASTER |
8 | # - BITBAKE_CHECKOUT_IMAGE_MASTER | 8 | # - BITBAKE_CHECKOUT_IMAGE_MASTER |
9 | image: docker:stable | 9 | image: docker:18 |
10 | stage: docker | 10 | stage: docker |
11 | services: | 11 | services: |
12 | - docker:dind | 12 | - docker:18-dind |
13 | before_script: | 13 | before_script: |
14 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | 14 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" |
15 | script: | 15 | script: |
@@ -26,10 +26,10 @@ | |||
26 | # parameters: | 26 | # parameters: |
27 | # - BITBAKE_IMAGE | 27 | # - BITBAKE_IMAGE |
28 | # - BITBAKE_CHECKOUT_IMAGE | 28 | # - BITBAKE_CHECKOUT_IMAGE |
29 | image: docker:stable | 29 | image: docker:18 |
30 | stage: docker | 30 | stage: docker |
31 | services: | 31 | services: |
32 | - docker:dind | 32 | - docker:18-dind |
33 | before_script: | 33 | before_script: |
34 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | 34 | - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" |
35 | script: | 35 | script: |