-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
89 lines (81 loc) · 2.52 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
variables:
DOCKER_DRIVER: overlay2
RELEASE_IMAGE: registry.gitlab.com/islandoftex/images/context
DOCKER_HUB_IMAGE: contextgarden/context
stages:
- build
- test
.buildtemplate: &builddefinition
stage: build
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker info
.testtemplate: &testdefinition
stage: test
script:
- context --version
- context test.mkiv
build:beta:
<<: *builddefinition
script:
- IMAGETAG="context-beta-`date +%Y-%m-%d-%H-%M`"
- docker build -f Dockerfile.mkivbeta --tag $RELEASE_IMAGE:$IMAGETAG --tag $RELEASE_IMAGE:beta --tag $DOCKER_HUB_IMAGE:beta .
- docker push $RELEASE_IMAGE:$IMAGETAG
- docker push $RELEASE_IMAGE:beta
- if [ ! -z "$PUSH_TO_DOCKER_HUB" ]; then docker push $DOCKER_HUB_IMAGE:beta; fi
rules:
- if: '$CTXBETA == "true"'
when: always
- when: never
build:current:
<<: *builddefinition
script:
- IMAGETAG="context-current-`date +%Y-%m-%d-%H-%M`"
- docker build -f Dockerfile.mkivcurrent --tag $RELEASE_IMAGE:$IMAGETAG --tag $RELEASE_IMAGE:current --tag $DOCKER_HUB_IMAGE:current .
- docker push $RELEASE_IMAGE:$IMAGETAG
- docker push $RELEASE_IMAGE:current
- if [ ! -z "$PUSH_TO_DOCKER_HUB" ]; then docker push $DOCKER_HUB_IMAGE:current; fi
rules:
- if: '$CTXCURRENT == "true"'
when: always
- when: never
build:lmtx:
<<: *builddefinition
script:
- IMAGETAG="context-lmtx-`date +%Y-%m-%d-%H-%M`"
- docker build -f Dockerfile.lmtx --tag $RELEASE_IMAGE:$IMAGETAG --tag $RELEASE_IMAGE:lmtx --tag $DOCKER_HUB_IMAGE:lmtx .
- docker push $RELEASE_IMAGE:$IMAGETAG
- docker push $RELEASE_IMAGE:lmtx
- if [ ! -z "$PUSH_TO_DOCKER_HUB" ]; then docker push $DOCKER_HUB_IMAGE:lmtx; fi
rules:
- if: '$CTXLMTX == "true"'
when: always
- when: never
test:beta:
<<: *testdefinition
needs: ["build:beta"]
image: registry.gitlab.com/islandoftex/images/context:beta
rules:
- if: '$CTXBETA == "true"'
when: always
- when: never
test:current:
<<: *testdefinition
needs: ["build:current"]
image: registry.gitlab.com/islandoftex/images/context:current
rules:
- if: '$CTXCURRENT == "true"'
when: always
- when: never
test:lmtx:
<<: *testdefinition
needs: ["build:lmtx"]
image: registry.gitlab.com/islandoftex/images/context:lmtx
rules:
- if: '$CTXLMTX == "true"'
when: always
- when: never