-
Notifications
You must be signed in to change notification settings - Fork 36
/
.gitlab-ci.yml
77 lines (69 loc) · 2.01 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
# This file's semantics are documented at
# https://docs.gitlab.com/ce/ci/yaml/README.html
include:
# This is the source of image variables used below.
- local: '/ci-support/docker/images.yml'
variables:
SD_STACK_ARGS: "--stack-root ${CI_PROJECT_DIR}/stack-root"
POSTGRES_DB: snowdrift_test
stages:
- build and test
- deploy
cache:
paths:
- stack-root
key:
files:
- stack.yaml.lock
.build-and-test:
stage: build and test
build and test:
extends: .build-and-test
image: "${image_build_centos_7}"
# Source: ci-support/docker/image-build-centos-7
services:
- postgres:9.3
# | If this gets much longer, turn it into an external script.
script:
# Make sure stack/ghc picks up changes to template files.
- touch website/src/Settings/StaticFiles.hs
- PGUSER=postgres PGHOST=postgres stack ${SD_STACK_ARGS} test --fast
deploy-build:
extends: .build-and-test
services:
- postgres:9.3
script:
# Build for deploy, using --pedantic
- PGUSER=postgres PGHOST=postgres DEPLOY=false ./ci-support/deploy
- stack ${SD_STACK_ARGS} build --copy-bins --local-bin-path keter-bin keter
# ... but don't force pedantry on people submitting MRs.
allow_failure: true
artifacts:
paths:
- SnowdriftReboot.keter
- keter-bin/keter
image: "${image_build_centos_7}"
deploy to OSUOSL:
stage: deploy
# Source: ci-support/docker/image-deploy/Dockerfile
image: "${image_deploy}"
cache:
paths: []
needs: ["deploy-build"]
script:
- BUILD=false ./ci-support/deploy
only:
# Only deploy from master.
#
# This is not a security measure, since someone could push a branch that
# changes this line. It's a convenience. Security is maintained by only
# allowing production secrets to be sent to protected branches.
- master@snowdrift/snowdrift
# The scheduled runs don't get deployed. FIXME: Why do we even have a
# scheduled run?
except:
- schedules
when: manual
environment:
name: production
url: https://snowdrift.coop