summaryrefslogtreecommitdiffstats
path: root/scripts/ci/gitlab/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ci/gitlab/.gitlab-ci.yml')
-rw-r--r--scripts/ci/gitlab/.gitlab-ci.yml48
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/ci/gitlab/.gitlab-ci.yml b/scripts/ci/gitlab/.gitlab-ci.yml
new file mode 100644
index 0000000..93ab062
--- /dev/null
+++ b/scripts/ci/gitlab/.gitlab-ci.yml
@@ -0,0 +1,48 @@
1stages:
2 - setup_docker
3 - setup_data
4 - execute
5
6variables:
7 DEBIAN_BITBAKE_MASTER_IMAGE: ${CI_REGISTRY_IMAGE}:ci-master-DEBIAN_BITBAKE
8 # The docker images will be specific to the branch we are pushing to
9 DEBIAN_BITBAKE_CI_IMAGE: ${CI_REGISTRY_IMAGE}:ci-${CI_COMMIT_REF_SLUG}-DEBIAN_BITBAKE
10 BITBAKE_CACHE: "/data/bitbake-cache"
11
12# Build the Docker image that will be used in subsequent CI/CD stages
13setup docker image:
14 image: docker:latest
15 stage: setup_docker
16 services:
17 - docker:dind
18 before_script:
19 - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
20 script:
21 - docker pull "$DEBIAN_BITBAKE_CI_IMAGE" || docker pull "$DEBIAN_BITBAKE_MASTER_IMAGE" || true
22 - docker build --pull --cache-from "$DEBIAN_BITBAKE_MASTER_IMAGE" --cache-from "$DEBIAN_BITBAKE_CI_IMAGE" -f "${CI_PROJECT_DIR}/scripts/ci/Dockerfile.bitbake" -t "$DEBIAN_BITBAKE_CI_IMAGE" .
23 - docker push "$DEBIAN_BITBAKE_CI_IMAGE"
24
25setup data:
26 stage: setup_data
27 image: "$DEBIAN_BITBAKE_CI_IMAGE"
28 artifacts:
29 paths:
30 - data/
31
32 script:
33 - mkdir data
34 - aws s3 ls s3://ota-gitlab-ci/
35 - aws s3 cp s3://ota-gitlab-ci/hereotaconnect_prod.zip data/credentials.zip
36 - chmod +x data/credentials.zip
37
38#Build step to perform bitbake or run oe-selftest based on input params
39oe-selftest:
40 image: "$DEBIAN_BITBAKE_CI_IMAGE"
41 stage: execute
42 dependencies:
43 - setup data
44
45 script:
46 - export DEVICE=${DEVICE:-'qemux86-64'}
47 - export REPO_BRANCH=${REPO_BRANCH:-'master'}
48 - scripts/ci/gitlab/bitbaker.sh \ No newline at end of file