forked from ngageoint/seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
62 lines (52 loc) · 1.56 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
variables:
ASCIIDOCTOR_IMAGE: rochdev/alpine-asciidoctor:mini
DIND_IMAGE: docker:dind
DOCKER_IMAGE: docker:stable
NODE_IMAGE: node:alpine
PYTHON_IMAGE: python:2-alpine
SASS_IMAGE: catchdigital/node-sass:8.12.0-alpine
image: ${DOCKER_IMAGE}
before_script:
- apk add -U jq bash
build:
services:
- ${DIND_IMAGE}
script:
- apk add -U git
- export SEED_LATEST=$(tail -1 .versions)
- export BUILD_TAG=${CI_COMMIT_TAG}
- mkdir -p output
# Use snapshot for remainder for master builds
- if [[ "${CI_COMMIT_TAG}x" == "x" ]] ; then ./set-version.sh ${SEED_LATEST}-snapshot; ./spec/examples/inject-manifests.sh; fi
- spec/generate-outputs.sh
- git checkout -- spec
# Build index.adoc WITHOUT snapshot tag
- if [[ "${CI_COMMIT_TAG}x" == "x" ]] ; then ./set-version.sh ${SEED_LATEST}; spec/examples/inject-manifests.sh; fi
- spec/add-version-links.sh
- docker run -v $(pwd)/spec:/documents --rm ${ASCIIDOCTOR_IMAGE} asciidoctor -D /documents/output index.adoc
- ./spec/collect-versioned-docs.sh
artifacts:
paths:
- spec/output
test:
image: ${NODE_IMAGE}
script:
- export SEED_LATEST=$(tail -1 .versions)
- npm install -g ajv-cli
# Use snapshot for remainder for master builds
- if [[ "${CI_COMMIT_TAG}x" == "x" ]] ; then ./set-version.sh ${SEED_LATEST}-snapshot; ./spec/examples/inject-manifests.sh; fi
- spec/examples/validate-examples.sh
cache:
paths:
- node_modules
pages:
stage: deploy
dependencies:
- build
script:
- mv spec/output public
artifacts:
paths:
- public
only:
- master