This repository has been archived by the owner on Jan 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
66 lines (57 loc) · 1.75 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
stages:
- build
- package
- deploy
variables:
PROJECT_NAME: open-data/site-open-data
# cache:
# untracked: true
image: sylus/gitlab-ci
services:
- sylus/gitlab-ci:dind
# 2x performance boost as vfs in dind is slow
# https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/
# https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1698#note_15746725
# https://gitlab.com/gitlab-org/gitlab-ce/issues/17861#note_12991518
variables:
DOCKER_DRIVER: overlay
before_script:
# Docker configuration
- docker info
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- echo "${SSH_PRIVATE_KEY}" | ssh-add -
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
build_job:
stage: build
script:
- echo "Building ${PROJECT_NAME} test runner"
- composer install --prefer-dist --no-interaction
- export COMPOSE_HTTP_TIMEOUT=200
- make build
- docker-compose -f docker-compose-ci.yml up -d
- docker ps -a
- sleep 20
- make drupal_install
- make test
# package_job:
# stage: package
# artifacts:
# name: "open-data-${CI_BUILD_REF_NAME}"
# when: on_success
# expire_in: 7 hrs 30 min
deploy_release:
stage: deploy
script:
- composer install --prefer-dist --no-interaction
- ./vendor/bin/dep --file=./docker/deploy.php deploy develop
dependencies:
- build_job
only:
- /v[0-9].*$/