-
Notifications
You must be signed in to change notification settings - Fork 69
/
.gitlab-ci.yml
80 lines (73 loc) · 2.41 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
variables:
IMAGE_TAG: "2021-09-28-1"
YOCTO_IMAGE: "amlogic-image-headless-initrd"
MACHINE_NAME: "amlogic-s9xxx"
IMAGE_NAME: "uImage"
IMAGE_TYPE: "uimage"
RAMDISK_COMP: "xz"
stages:
- docker
- initrd
build:docker:
stage: docker
tags:
- yocto
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
image: docker:stable
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG && exit 0 || true
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$IMAGE_TAG --tag $CI_REGISTRY_IMAGE:latest scripts/
- docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG
- docker push $CI_REGISTRY_IMAGE:latest
build:initrd:
tags:
- yocto
stage: initrd
image: $CI_REGISTRY_IMAGE:$IMAGE_TAG
before_script:
- mkdir -p results
- rm -rf /tmp/build_env
- git clone http://github.com/openembedded/openembedded-core --branch=mickledore --depth=1 /tmp/build_env
- git clone http://github.com/openembedded/bitbake --branch=2.4 --depth=1 /tmp/build_env/bitbake
- git clone $(pwd) /tmp/build_env/$(basename $(pwd))
script:
- bash scripts/prepare.sh /tmp/build_env
- bash scripts/build.sh /tmp/build_env $MACHINE_NAME $YOCTO_IMAGE
- cp -ar /tmp/build_env/build/tmp*/deploy/images/$MACHINE_NAME/* $CI_PROJECT_DIR/results/
artifacts:
when: always
paths:
- results/
.gen:
stage: gen
tags:
- yocto
needs: ["build:initrd"]
dependencies:
- build:initrd
image: $CI_REGISTRY_IMAGE:$IMAGE_TAG
script:
- python3 scripts/generate_lava.py
--template scripts/meta-meson.yml.jinja2
--info "$CI_PIPELINE_URL for $DEVICE_TYPE at $CI_COMMIT_REF_NAME"
--base-artifacts-url $CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/raw/results
--device-type ${DEVICE_TYPE}
--kernel-image-name "`readlink results/${IMAGE_NAME}`"
--kernel-image-type ${IMAGE_TYPE}
--dtb-name "`readlink results/${DTB_NAME}`"
--ramdisk-name "`readlink results/${YOCTO_IMAGE}-${MACHINE_NAME}.cpio.${RAMDISK_COMP}`"
--ramdisk-compression ${RAMDISK_COMP}
--boot-method ${BOOT_METHOD}
--tags "${LAVA_TAGS}"
> results/meta-meson-$DEVICE_TYPE.yml
artifacts:
when: always
paths:
- results/