-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
85 lines (78 loc) · 2 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
stages:
- compile
- prepare
- deploy
###########
## BUILD ##
###########
compile-elm:
stage: compile
tags:
- elm
before_script:
- source /etc/profile
script:
- rm -rf ./elm-stuff/
- make
- make docs
- tar -czf ${CI_COMMIT_SHA}.tar.gz docs.json README.md
- echo "export BUILD_JOB_ID=${CI_JOB_ID}" > variables
artifacts:
expire_in: 1 day
name: $CI_COMMIT_SHA
when: on_success
paths:
- ./$CI_COMMIT_SHA.tar.gz
- ./variables
only:
- master
- /^\d*-.*/
prepare-docs:
stage: prepare
tags:
- shell
variables:
GIT_STRATEGY: none
before_script:
- source variables
script:
- ssh -i ~/.ssh/id_rsa -t [email protected] "sudo /root/deploy/deploy.sh
--action prepare
--deploy-type site
--target sandbox
--root-dir /var/www/elm-doc/${CI_PROJECT_NAME}/${CI_COMMIT_REF_SLUG}
--project-type elm
--project ${CI_PROJECT_NAME}
--namespace ${CI_PROJECT_NAMESPACE}
--commit ${CI_COMMIT_SHA}
--build ${BUILD_JOB_ID}"
only:
- master
- /^\d*-.*/
deploy-docs:
stage: deploy
tags:
- shell
variables:
GIT_STRATEGY: none
before_script:
- source variables
script:
- ssh -i ~/.ssh/id_rsa -t [email protected] "sudo /root/deploy/deploy.sh
--action deploy
--deploy-type site
--target sandbox
--root-dir /var/www/elm-doc/${CI_PROJECT_NAME}/${CI_COMMIT_REF_SLUG}
--symlink-subdir .
--project-type elm
--project ${CI_PROJECT_NAME}
--namespace ${CI_PROJECT_NAMESPACE}
--commit ${CI_COMMIT_SHA}
--build ${BUILD_JOB_ID}"
dependencies: []
environment:
name: docs-$CI_COMMIT_REF_SLUG
url: http://elm-doc.stage.webbhuset.com/?repo=$CI_PROJECT_NAME&version=$CI_COMMIT_REF_SLUG
only:
- master
- /^\d*-.*/