-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
102 lines (95 loc) · 2.81 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
image: docker:latest
services:
- docker:dind
stages:
- build
- howitzer
- upload
- artifact_image
variables:
GADGET_CONTAINER: ${CI_REGISTRY}/nextthingco/buildroot-development-container:testing
HOWITZER_CONTAINER: ${CI_REGISTRY}/gadget/howitzer-container:master
NAND_TYPE: Toshiba_512M_SLC
UPLOAD_CONTAINER: ${CI_REGISTRY}/nextthingco/ci-tools:${GHVAR_UPLOAD_CONTAINER_BRANCH}
# ARTIFACT_0: output/images/rootfs.ubi.sparse
# ARTIFACT_1: output/images/spl-40000-1000-100.bin
# ARTIFACT_2: output/images/uboot-40000.bin
# ARTIFACT_3: output/images/uboot.script
ARTIFACT_4: output/images/${CI_BUILD_REF_SLUG}-chip-pro-${CI_PROJECT_NAME}-b${CI_PIPELINE_ID}-${NAND_TYPE}.chp
GHVAR_SLACK_CHANNEL: ${GHVAR_SLACK_CHANNEL}
GHVAR_SLACK_HOOK: ${GHVAR_SLACK_HOOK}
SSH_KEY_DIR: /root/.ssh/
no_docker: "something"
build:
image: ntc-registry.githost.io/nextthingco/buildroot-development-container:testing
stage: build
tags: [aws-auto-runner]
script:
- mkdir ${SSH_KEY_DIR}/
- ssh-keyscan ntc.githost.io > ${SSH_KEY_DIR}/known_hosts
- echo "${SSH_KEY_SECRET}" > ${SSH_KEY_DIR}/id_rsa
- echo "${SSH_CONFIG}" > ${SSH_KEY_DIR}/ssh_config
- chmod 0600 ${SSH_KEY_DIR}/*
# - scripts/build-gadget make -s chippro_defconfig
# - scripts/build-gadget make -s
- make -s chippro_defconfig
- make -s
- ls /opt/output/images
- mkdir -p output
- mv /opt/output/images output/images
# - tar -czf dlcache.tar.gz /opt/dlcache
# - tar -czf build.tar.gz /opt/output/build
# - tar -czf gadget-os-proto.tar.gz /opt/gadget-os-proto
# - tar -czf local.tar.gz /local
# - tar -czf tmp.tar.gz /tmp
artifacts:
expire_in: 20 minutes
when: always
paths:
- output/images/*
# - dlcache.tar.gz
# - build.tar.gz
# - gadget-os-proto.tar.gz
# - local.tar.gz
# - tmp.tar.gz
howitzer:
image: ntc-registry.githost.io/gadget/howitzer-container:master
stage: howitzer
tags: [aws-auto-runner]
dependencies:
- build
script:
- ls output/images
- /bin/bash -x scripts/flash-gadget
- howitzer nand ${NAND_TYPE} chp fel.chp chp fastboot.chp -f ${ARTIFACT_4}
artifacts:
expire_in: 2 days
when: always
paths:
- output/images/*
upload:
image: ntc-registry.githost.io/nextthingco/ci-tools:unstable
stage: upload
tags: [aws-auto-runner]
dependencies:
- build
- howitzer
script:
- ls -al
- mkdir -p /upload
- mv output /upload/output
- cd /upload
- ls -al /upload/output/images
- ci-s3-upload ${ARTIFACT_4}
artifacts:
expire_in: 2 days
when: always
paths:
- /upload/*
artifact_image:
stage: artifact_image
tags: [aws-auto-runner]
script:
- apk update && apk add git coreutils bash
- docker login -u ${BUILDER_UN} -p ${BUILDER_PW}
- /bin/bash -ex ./gen-dockerfiles.sh