forked from stfbohn/coopcycle-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
63 lines (52 loc) · 1.77 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
test:
stage: test
image: coopcycle/coopcycle-web-test:latest
# Select what we should cache between builds
cache:
paths:
- vendor/
before_script:
# Configure JSON Web Token
- mkdir -p var/jwt
- openssl genrsa -out var/jwt/private.pem 4096
- openssl rsa -pubout -in var/jwt/private.pem -out var/jwt/public.pem
# Install composer dependencies
- composer install --prefer-dist --no-progress --no-suggest
# Install PHP app
- cp app/config/parameters.yml.gitlab app/config/parameters.yml
- php bin/console doctrine:schema:create --env=test
- cp phpunit.xml.dist phpunit.xml
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
# See http://docs.gitlab.com/ce/ci/services/README.html for examples.
services:
- name: mdillon/postgis:9.4-alpine
alias: postgres
- redis:alpine
- name: coopcycle/osrm-test
alias: osrm
- name: stripemock/stripe-mock:latest
alias: stripe_mock
# Set any variables we need
variables:
POSTGRES_DB: coopcycle_test
SYMFONY_ENV: test
script:
- "vendor/bin/phpunit"
- "php vendor/bin/behat -f progress"
deploy_paris:
image: coopcycle/deployer:latest
stage: deploy
script:
- mkdir -p ~/.ssh
- echo "$DEPLOY_PRIVATE_KEY" > /root/.ssh/id_rsa
- echo "$DEPLOY_PUBLIC_KEY" > /root/.ssh/id_rsa.pub
- chmod 700 /root/.ssh
- chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub
- cd /app
# enable agent forwarding so deployer can pull github from production server
- eval `ssh-agent -s` && ssh-add
- php vendor/bin/dep deploy --hosts=paris.coopcycle.org
environment:
name: paris
only:
- master