-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy path.gitlab-ci.yml
78 lines (69 loc) · 1.6 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
image: yawik/build
# Cache libraries in between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- "$CI_PROJECT_DIR/vendor/"
- "$CI_PROJECT_DIR/node_modules//"
- "$HOME/.composer/cache"
- "$HOME/.npm"
stages:
- build
- test
- deploy
services:
- mongo:latest
- selenium/standalone-chrome
before_script:
- mkdir -p /var/www/cache/
- chown yawik /var/www/cache/
- mkdir -p config/autoload
- cp etc/gitlab/autoload/*.* config/autoload
- chown -R yawik /builds/yawik/yawik
composer:
stage: build
cache:
key: build-cache
paths:
- vendor/
script:
- pwd
- su yawik -c "composer install"
phpunit:
stage: test
allow_failure: true
cache:
key: build-cache
paths:
- vendor/
script:
- cp ./etc/gitlab/autoload/*.* config/autoload
- ./vendor/bin/phpunit
behat:
stage: test
allow_failure: true
cache:
key: build-cache
paths:
- vendor/
script:
- su yawik -c "composer install"
- cp ./etc/gitlab/autoload/*.* config/autoload
- mkdir -p build/behat
- mkdir -p build/mails
- composer run serve --timeout=0 > /dev/null 2>&1 &
- ./vendor/bin/behat --strict --no-interaction
deploy_odm3:
stage: deploy
environment:
name: staging/$CI_COMMIT_REF_NAME
url: http://staging.yawik.org
only:
- odm-module3
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
- dep deploy --branch=odm-module3 staging