-
Notifications
You must be signed in to change notification settings - Fork 3
/
testspec.yml
22 lines (20 loc) · 1.08 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 pg -d -p 5432:5432 postgres
- docker run --name test -d -e RAILS_ENV=test --link pg:pg 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' && rake db:create"
- docker exec test /bin/bash -c "export DATABASE_URL='postgres://postgres@pg:5432/test?template=template0&pool=5&encoding=unicode' && rake db:setup"
- docker exec test /bin/bash -c "export DATABASE_URL='postgres://postgres@pg:5432/test?template=template0&pool=5&encoding=unicode' && export API_ROOT='https://ccs.api/' && rake"
- docker rm -f test pg
post_build:
commands: