forked from lsds/sgx-lkl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
148 lines (135 loc) · 3.83 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
stages:
- build
- package
- mirror
.default_cache: &default_cache
key: ${CI_COMMIT_REF_SLUG}
paths:
- .git/modules
- host-musl
- lkl
- sgx-lkl-musl
variables:
GSG_RELEASE_BRANCHES: master
version:
stage: .pre
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- echo RELEASE_VERSION=$(release --bump-patch next-version) > version.env
artifacts:
reports:
dotenv: version.env
except:
- tags
prepare_submodules:
image: alpine
stage: .pre
cache:
<< : *default_cache
policy: pull-push
before_script:
- apk --no-cache add git
script:
- git submodule sync
- git submodule update --init host-musl sgx-lkl-musl
- rm -rf lkl
- git clone --branch sgx-lkl-state --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/madana-io/linux.git lkl
build_simulation:
image: $CI_REGISTRY_IMAGE:latest
stage: build
cache:
<< : *default_cache
policy: pull
before_script:
- git submodule sync
- git submodule update --init host-musl sgx-lkl-musl
- rm -rf lkl
- git clone --branch sgx-lkl-state --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/madana-io/linux.git lkl
script:
- sudo chown -R $(id -u):$(id -g) .
#- cd lkl && git status && git checkout -f HEAD && cd ../
- make sim DEBUG=0
- mv build simulation
artifacts:
paths:
- simulation/
build_hardware:
image: $CI_REGISTRY_IMAGE:latest
stage: build
cache:
<< : *default_cache
policy: pull
before_script:
- git submodule sync
- git submodule update --init host-musl sgx-lkl-musl
- rm -rf lkl
- git clone --branch sgx-lkl-state --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/madana-io/linux.git lkl
script:
- sudo chown -R $(id -u):$(id -g) .
#- cd lkl && git status && git checkout -f HEAD && cd ../
- make DEBUG=0
- make sgx-lkl-sign
- mv build hardware
artifacts:
paths:
- hardware/
build_hardware_debug:
image: $CI_REGISTRY_IMAGE:latest
stage: build
cache:
<< : *default_cache
policy: pull
before_script:
- git submodule sync
- git submodule update --init host-musl sgx-lkl-musl
- rm -rf lkl
- git clone --branch sgx-lkl-state --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/madana-io/linux.git lkl
script:
- sudo chown -R $(id -u):$(id -g) .
- make DEBUG=1
- make sgx-lkl-sign
- mv build hardware_debug
artifacts:
paths:
- hardware_debug/
build_container:
image: docker:latest
#image: quay.io/containers/buildah:v1.16.2
stage: package
tags:
- dind
services:
- docker:dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:latest || true
- >
docker build --pull
--tag $CI_REGISTRY_IMAGE:$RELEASE_VERSION
--cache-from $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$RELEASE_VERSION
- docker tag $CI_REGISTRY_IMAGE:$RELEASE_VERSION $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- >
if [ "$CI_COMMIT_REF_SLUG" == "master" ]; then
docker tag $CI_REGISTRY_IMAGE:$RELEASE_VERSION $CI_REGISTRY_IMAGE:latest
docker push $CI_REGISTRY_IMAGE:latest
fi
except:
- tags
mirror_github:
image: quay.io/containers/buildah:latest
stage: mirror
script:
- buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- buildah pull $CI_REGISTRY_IMAGE:latest || true
- buildah login -u $GITREPOUSER -p $GITREPOTOKEN $GITHUB_REGISTRY
- buildah tag $CI_REGISTRY_IMAGE:latest $GITHUB_REGISTRY_IMAGE:latest
- buildah push $GITHUB_REGISTRY_IMAGE:latest
#trigger_build_docker:
# stage: .post
# trigger: madana-io/madana-dan-docker