-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
29 lines (25 loc) · 1.02 KB
/
.travis.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
services: docker
language: generic
before_install:
# Strips out dashes in organization names because they are not allowed in dockerhub
- export DOCKER_REPO=`awk -F/ '{gsub("-","",$1)};{print $1"/"$2}' <<<$TRAVIS_REPO_SLUG | tr '[:upper:]' '[:lower:]'`
- export IMAGE_SLUG="$TRAVIS_BRANCH.${TRAVIS_COMMIT::8}.${TRAVIS_BUILD_ID}"
- docker -v
- cp .env.example .env
# Stop the postgres instance travis sets up automatically
- sudo /etc/init.d/postgresql stop
# set env vars in the build settings to interact with repositories
# see https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
# Start the docker stuff
- docker-compose -v
- docker-compose up -d
- sleep 4
- docker-compose ps
script:
# Seed database
- docker-compose exec --user="root" greanleaf php artisan migrate --seed
# Run tests
- docker-compose exec --user="root" greanleaf php vendor/bin/codecept run api
after_script:
- docker images