forked from hermit-os/loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
65 lines (59 loc) · 1.5 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
stages:
- prepare
- build
- deploy
variables:
DOCKER_FILE: Dockerfile
DOCKER_TAG: latest
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
IMAGE: ${CI_REGISTRY_IMAGE}
GIT_SUBMODULE_STRATEGY: normal
GIT_LFS_SKIP_SMUDGE: 1
FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
.prepare:docker: &prepare_docker
stage: prepare
image:
name: docker
before_script:
- docker version
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} .
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
tags:
- docker
prepare:docker:
<<: *prepare_docker
build:loader:
stage: build
image: ${CI_REGISTRY_IMAGE}
script:
- make release=1
artifacts:
paths:
- target/x86_64-unknown-hermit-loader/release/rusty-loader
.deploy:loader: &loader
stage: deploy
dependencies:
- build:loader
image:
name: docker
before_script:
- docker version
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- |
cat << END > ${DOCKER_FILE}
FROM alpine:3.14
RUN apk add --no-cache qemu-system-x86_64 qemu-modules
ADD target/x86_64-unknown-hermit-loader/release/rusty-loader /hermit/
END
- docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}/loader:latest .
- docker push ${DOCKER_IMAGE}/loader:latest
tags:
- docker
only:
refs:
- master
deploy:loader:
<<: *loader