-
Notifications
You must be signed in to change notification settings - Fork 256
/
.gitlab-ci.yml
54 lines (50 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
stages:
- test
- build
variables:
POSTGRES_DB: "openloyalty"
POSTGRES_USER: "openloyalty"
POSTGRES_PASSWORD: "openloyalty"
php-7.0:
image: tetraweb/php:7.0
stage: test
services:
- elasticsearch:2.2
- postgres:latest
script:
- echo "memory_limit = 512M" > /usr/local/etc/php/conf.d/memory.ini
- cd backend
- docker-php-ext-enable zip pdo pgsql pdo_pgsql mbstring intl bcmath
- "sed -i 's/database_host: .*/database_host: postgres/g' app/config/parameters.yml.dist"
- "sed -i 's/elastica_host: .*/elastica_host: elasticsearch/g' app/config/parameters.yml.dist"
- composer self-update
- composer install
- bin/console oloy:user:projections:index:create --drop-old
- bin/console doctrine:schema:update --env=test -n --force
- bin/console broadway:event-store:schema:drop
- bin/console broadway:event-store:schema:init
- bin/console doctrine:fixtures:load --env=test -n
- bin/console assets:install --env=test
- bin/console security:check
- bin/console doctrine:schema:validate --env=test --skip-sync
- vendor/phpunit/phpunit/phpunit
- bin/php-cs-fixer fix --dry-run --diff src
phpqa:
image: eu.gcr.io/accesto-150506/accesto/phpqa:latest
stage: test
allow_failure: true
script:
- phpmd ./backend/src text /config/phpmd_accesto.xml
build:
tags:
- docker_builder
only:
- tags
- triggers
stage: build
script:
- docker login -u _json_key -p "$REGISTRY_JSON_KEY" https://eu.gcr.io
- docker build -t eu.gcr.io/openloyalty/backend:$CI_BUILD_REF_NAME ./backend/
- docker build -t eu.gcr.io/openloyalty/frontend:$CI_BUILD_REF_NAME ./frontend/
- docker push eu.gcr.io/openloyalty/backend:$CI_BUILD_REF_NAME
- docker push eu.gcr.io/openloyalty/frontend:$CI_BUILD_REF_NAME