-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
155 lines (140 loc) · 4.28 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
stages:
- docker
- build
- deploy
.docker:
when: manual
stage: docker
tags:
- docker-builder-arm
image: git.oxfordnanolabs.local:4567/traque/ont-docker-base/ont-base-docker:latest
script:
- TAG="${CI_REGISTRY_IMAGE}/${CI_JOB_NAME#docker-}"
- echo "Building ${TAG} from ${DOCKER_FILE}"
- build_args=$(env | grep "^BUILD_ARG_" | sed 's/^BUILD_ARG_/--build-arg\n/g')
- echo "$build_args"
- echo "$build_args" | tr '\n' '\0' | xargs -0 docker build --no-cache --pull
-t "${TAG}" -f "${DOCKER_FILE}" ./docker
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push "${TAG}"
docker-u16.04-k4.4.197:
extends: .docker
variables:
DOCKER_FILE: "./docker/Dockerfile.16.04"
BUILD_ARG_BUILD_TAG: "minion1c_v1.1.0"
docker-u18.04-k4.9.140:
extends: .docker
variables:
DOCKER_FILE: "./docker/Dockerfile.headers"
BUILD_ARG_UBUNTU_VERSION: "18.04"
BUILD_ARG_HEADERS_PACKAGE_URL: "https://artifactory.oxfordnanolabs.local/artifactory/ONT-Deb/pool/linux-headers-4.9.140-minit_32.4.3-v1.0.3_arm64.deb"
docker-u18.04:
extends: .docker
variables:
DOCKER_FILE: "./docker/Dockerfile.package"
BUILD_ARG_UBUNTU_VERSION: "18.04"
.build:
stage: build
tags:
- linux_aarch64
script:
- make
build-u18.04-k4.9.140:
extends: .build
image: "${CI_REGISTRY_IMAGE}/u18.04-k4.9.140"
variables:
KERNELRELEASE: "4.9.140-minit"
.package:
stage: build
tags:
- linux_aarch64
script:
- |
if ! command -v pandoc > /dev/null || ! command -v lintian > /dev/null
then
apt -q update
apt -q -y install lintian pandoc
fi
- make dist-deb
- lintian --display-info *.deb
artifacts:
paths:
- "*.deb"
package-u16.04-k4.4.38:
extends: .package
image: "docker-registry.oxfordnanolabs.local:5000/kernel-dev-aarch64"
variables:
KERNELRELEASE: "4.4.38-minit"
COMPILED_DRIVER_PACKAGE: "1"
artifacts:
paths:
# let the 4.4.197 job provide all the userspace stuff
- "ont-minion1c-driver-${KERNELRELEASE}_*_arm64.deb"
package-u16.04-k4.4.197:
extends: .package
image: "${CI_REGISTRY_IMAGE}/u16.04-k4.4.197"
variables:
KERNELRELEASE: "4.4.197-minit"
COMPILED_DRIVER_PACKAGE: "1"
artifacts:
paths:
# omit dkms
- "ont-minion1c-driver-${KERNELRELEASE}_*_arm64.deb"
- "ont-minion1c-driver-dev_*.deb"
- "ont-minion1c-driver-udev_*.deb"
- "ont-minion1c-driver-utils_*.deb"
package-u18.04-k4.9.140:
extends: .package
image: "${CI_REGISTRY_IMAGE}/u18.04-k4.9.140"
variables:
KERNELRELEASE: "4.9.140-minit"
COMPILED_DRIVER_PACKAGE: "1"
artifacts:
paths:
# omit dkms
- "ont-minion1c-driver-${KERNELRELEASE}_*_arm64.deb"
- "ont-minion1c-driver-dev_*.deb"
- "ont-minion1c-driver-udev_*.deb"
- "ont-minion1c-driver-utils_*.deb"
package-u18.04-dkms:
extends: .package
image: "${CI_REGISTRY_IMAGE}/u18.04"
variables:
KERNELRELEASE: "4.4.197-minit"
.publish: &publish
stage: deploy
image: git.oxfordnanolabs.local:4567/traque/ont-docker-base/ont-base-ubuntu:20.04
when: manual
tags:
- linux
only:
- tags
dependencies:
- package-u16.04-k4.4.38
- package-u16.04-k4.4.197
- package-u18.04-k4.9.140
- package-u18.04-dkms
script:
- for deb in ont-minion1c-driver*.deb; do
- arch=$(dpkg --field "${deb}" Architecture)
- dist=$(dpkg --field "${deb}" Version | cut -d '~' -f 2)
- url="https://artifactory.oxfordnanolabs.local/artifactory/${REPO}/pool/$(basename "${deb}");commitSHA=${CI_COMMIT_SHA};deb.distribution=${dist};deb.component=non-free;deb.architecture=${arch}"
- echo "Uploading ${deb} to ${url}"
- ' curl -LfsS
--request PUT
--user "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}"
--header "X-Checksum-Sha256: $(sha256sum "${deb}" | cut -d " " -f 1)"
--header "X-Checksum-Md5: $(md5sum "${deb}" | cut -d " " -f 1)"
--upload-file "${deb}"
"${url}"'
- echo "Artifact is available at https://artifactory.oxfordnanolabs.local/artifactory/webapp/#/artifacts/browse/tree/General/${REPO}/pool/$(basename "${deb}")"
- done
publish-ONTDev-Deb:
<<: *publish
variables:
REPO: ONTDev-Deb
publish-ONT-Deb:
<<: *publish
variables:
REPO: ONT-Deb
# vim:et:sw=2:sts=2