forked from parti-renaissance/espace-adherent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
90 lines (81 loc) · 3.19 KB
/
circle.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
85
86
87
88
89
90
machine:
node:
version: 4.5.0
php:
version: 7.1.6
environment:
YARN_VERSION: 0.18.1
PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
DATABASE_HOST: 127.0.0.1
DATABASE_USER: ubuntu
DATABASE_PASSWORD: ''
DATABASE_NAME: circle_test
RABBITMQ_HOST: 'localhost'
RABBITMQ_PORT: '5672'
RABBITMQ_USER: 'guest'
RABBITMQ_PASSWORD: 'guest'
hosts:
enmarche.dev: 127.0.0.1
m.enmarche.dev: 127.0.0.1
legislatives.enmarche.dev: 127.0.0.1
services:
- docker
- rabbitmq-server
dependencies:
cache_directories:
- ~/.yarn
- ~/.cache/yarn
- ~/.composer/cache/files
pre:
- |
if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
fi
- echo "memory_limit = 2048M" > /opt/circleci/php/$(phpenv global)/etc/conf.d/memory.ini
- rm /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
override:
- yarn install
- composer install --no-interaction
- bin/console rabbitmq:setup-fabric --env=test
test:
override:
# Lint and test JS
- yarn lint
- yarn test
# Lint PHP
- php -d memory_limit=1024m vendor/bin/php-cs-fixer fix --diff --dry-run --no-interaction -v
# Prepare PHP tests
- rm -rf var/cache/test /tmp/data.db app/data/dumped_referents_users:
parallel: true
- ./bin/console doctrine:schema:create --env=test_sqlite:
parallel: true
- ./bin/console doctrine:schema:drop --force --env=test_mysql:
parallel: true
- ./bin/console doctrine:schema:create --env=test_mysql:
parallel: true
- mkdir -p $CIRCLE_TEST_REPORTS/phpunit:
parallel: true
# PHP unit and functional tests
- yarn run build-amp
- case $CIRCLE_NODE_INDEX in 0) ./vendor/bin/phpunit --group $GROUP1 --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml ;; 1) ./vendor/bin/phpunit --group $GROUP2 --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml ;; 2) ./vendor/bin/phpunit --exclude-group $GROUP1,$GROUP2 --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml ;; esac:
parallel: true
environment:
GROUP1: adherent,amp,article,boardMember,citizenInitiative,citizenInitiativeManager,citizenProject,referent,summary
GROUP2: committee,committeeManager,coordinator,documents,donation,eventManager,explainer,facebook,home,invitation,legislatives,jeMarche,map,membership
# Try to build production JS
- yarn run build-prod
deployment:
master:
branch: master
owner: EnMarche
commands:
# Builds and pushes image to registry
- ./scripts/build.sh stable
staging:
branch: staging
owner: EnMarche
commands:
# Builds and pushes image to registry
- ./scripts/build.sh latest
# Deploys image and migrates database
- ./scripts/deployment.sh