forked from TheRestartProject/RepairDirectory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
144 lines (136 loc) · 2.9 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
stages:
- build
- test
- cleanup
# - deploy
build:php:
image: registry.outlandish.com/the-restart-project/repair-directory/composer
stage: build
script:
- composer run-script fixometer:config
- composer install
- composer run-script post-root-package-install
- composer run-script key:generate
tags:
- docker
only:
- master
- /^feature-.*$/
artifacts:
paths:
- ./
name: "${CI_BUILD_REF_NAME}"
expire_in: 1 hour
build:node:
image: node:6
stage: build
script:
- yarn
- npm run production
- rm -rf node_modules
tags:
- docker
only:
- master
- /^feature-.*$/
artifacts:
paths:
- ./
name: "${CI_BUILD_REF_NAME}"
expire_in: 1 hour
test:static-analysis:
image: registry.outlandish.com/the-restart-project/repair-directory/composer
dependencies:
- build:php
stage: test
allow_failure: true
script:
- composer run-script code
tags:
- docker
only:
- master
- /^feature-.*$/
test:unittests:
image: registry.outlandish.com/the-restart-project/repair-directory/composer
dependencies:
- build:php
stage: test
script:
- composer run-script test:unit
tags:
- docker
only:
- master
- /^feature-.*$/
cleanup:
image: registry.outlandish.com/the-restart-project/repair-directory/composer
dependencies:
- build:php
- build:node
stage: cleanup
script:
- composer install --no-dev
- rm -rf .git
- rm .env
tags:
- docker
only:
- master
artifacts:
paths:
- ./
name: "${CI_BUILD_REF_NAME}"
expire_in: 1 day
#deploy:heroku:
# dependencies:
# - build:php
# - build:node
# image: ruby:2.2
# stage: deploy
# tags:
# - docker
# before_script:
# - gem install dpl
# script:
# - "echo 'web: php artisan doctrine:migrations:refresh && php artisan restart:import:businesses data/all.csv && $(composer config bin-dir)/heroku-php-apache2 public/' > ./Procfile"
# - dpl --provider=heroku --app=restartproject --api-key=$HEROKU_STAGING_API_KEY --skip-cleanup
# environment:
# name: staging
# url: https://restartproject.herokuapp.com/
# only:
# - master
#deploy:staging:
# dependencies:
# - cleanup
# stage: deploy
# before_script:
# - "apt-get update && apt-get install sshpass"
# script:
# - 'sed -i "s|APP_URL=.*|APP_URL=http://community-staging.therestartproject.org|" .env'
# - 'sed -i "s|APP_DEBUG=.*|APP_DEBUG=true|" .env'
# - 'sed -i "s|APP_ENV=.*|APP_ENV=production|" .env'
# - 'sed -i "s|DB_HOST=.*|DB_HOST=${}|".env'
# - 'sed -i "s|DB_HOST=.*|DB_HOST=${}|".env'
# tags:
# - docker
# only:
# - master
# - new-deploy-process
# deploy:production:
# dependencies:
# - build
# stage: deploy
# script:
# - php composer.phar install --no-dev
# - rm composer.phar
# - rm -rf .git
# tags:
# - docker
# only:
# - tags
# artifacts:
# paths:
# - ./
# name: "${CI_BUILD_REF_NAME}"
# expire_in: 1 week