forked from butlerjim/alt_tes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
48 lines (42 loc) · 1.26 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
image: registry.gitlab.com/citygro/docker-and-compose
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
stages:
- build
- test
# - deploy
build:
stage: build
script:
- docker info
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
- docker-compose build --pull web
- docker-compose push web
after_script:
- docker-compose stop
test:
script:
- docker-compose run web bash -c 'bundle && bundle exec rake db:create db:migrate db:test:prepare RAILS_ENV=test'
- docker-compose exec solr bash -c 'bin/solr create -c development -d /opt/config' || true
- docker-compose run web bundle exec rake
- docker-compose run web bundle exec rake assets:precompile
after_script:
- docker-compose stop
#staging:
# image: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
# type: deploy
# script:
# - gem install dpl multi_json
# - # TODO DEPLOY COMMAND dpl --provider=heroku --app=east-west-payroll-staging --api-key=$HEROKU_STAGING_API_KEY
# only:
# - master
#
#production:
# image: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
# type: deploy
# script:
# - gem install dpl multi_json
# - # TODO DEPLOY COMMAND dpl --provider=heroku --app=east-west-payroll --api-key=$HEROKU_PRODUCTION_API_KEY
# when: manual