forked from DFE-Digital/teaching-vacancies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestspec.yml
21 lines (20 loc) · 1.14 KB
/
testspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
version: 0.2
phases:
pre_build:
commands:
- echo Build started on `date`
- echo Entered the pre_build phase...
- echo Building the Docker image...
- docker build --build-arg RAILS_ENV=test -t temp_image:test .
build:
commands:
- echo Testing the newly built Docker image...
- docker run --name es -d -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:6.0.1
- docker run --name pg -d -p 5432:5432 postgres
- docker run --name test -d -e RAILS_ENV=test --link pg:pg --link es:es temp_image:test /bin/bash -c "tail -f /dev/null"
- docker exec test bundle install --with test --retry 3 --jobs 20
- docker exec test /bin/bash -c "export DATABASE_URL='postgres://postgres@pg:5432/test?template=template0&pool=5&encoding=unicode' && export ELASTICSEARCH_URL='http://es:9200' && rake db:setup"
- docker exec test /bin/bash -c "export DATABASE_URL='postgres://postgres@pg:5432/test?template=template0&pool=5&encoding=unicode' && export ELASTICSEARCH_URL='http://es:9200' && rake"
- docker rm -f test es pg
post_build:
commands: