generated from DreamingRaven/pyrtd
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
50 lines (47 loc) · 1.55 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
# @Author: GeorgeRaven <archer>
# @Date: 2020-10-20T23:58:25+01:00
# @Last modified by: archer
# @Last modified time: 2021-07-15T11:52:15+01:00
# @License: please see LICENSE file in project root
stages:
- build
- test
- deploy
docker_build:
stage: build
image: docker:stable
services:
- docker:dind
before_script:
- docker info
only:
- master
- staging
before_script:
- docker login registry.gitlab.com -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
script:
- docker build -t "$(echo ${CI_REGISTRY}/${CI_PROJECT_PATH}:${CI_COMMIT_BRANCH} | tr "[:upper:]" "[:lower:]")" -f Dockerfile_archlinux .
- docker push "$(echo ${CI_REGISTRY}/${CI_PROJECT_PATH}:${CI_COMMIT_BRANCH} | tr "[:upper:]" "[:lower:]")"
after_script:
- docker logout ${CI_REGISTRY}
tags:
- docker
pages:
stage: deploy
image: docker:stable
services:
- docker:dind
only:
- staging
script:
# set variables like source code version
- export SRC_VER="$(set -o pipefail && git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")"
# generate public artifact path
- mkdir -p ./public
# make documentation and output to volume in artifact directory
- docker run --entrypoint "" -v ${PWD}/public:/app/docs/build/html -t "$(echo ${CI_REGISTRY}/${CI_PROJECT_PATH}:${CI_COMMIT_BRANCH} | tr "[:upper:]" "[:lower:]")" make -C ./docs html
# display URL of pages
- echo "${CI_PAGES_URL}"
artifacts:
paths:
- public