mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
Use a script/cibuild to control the CI process
We need some extra setup work that's easier to accomplish in a separate script than embedding it all in the Travis CI configuration. Follow the scripts-to-rule-them-all pattern from GitHub and add a script/cibuild for that purpose.
This commit is contained in:
parent
68ce8ad1ae
commit
7dd8e8caec
2 changed files with 28 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ before_install:
|
||||||
- chmod 0755 docker-compose
|
- chmod 0755 docker-compose
|
||||||
- sudo mv docker-compose /usr/local/bin
|
- sudo mv docker-compose /usr/local/bin
|
||||||
install: true
|
install: true
|
||||||
script: "cp config/site.yml.tmpl config/site.yml ; docker-compose build ; bin/rake ci:lite"
|
script: "script/cibuild"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
|
|
|
||||||
27
script/cibuild
Executable file
27
script/cibuild
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
docker_compose="docker-compose --file docker-compose.yml"
|
||||||
|
|
||||||
|
function cleanup() {
|
||||||
|
$docker_compose down
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
export RAILS_ENV=test
|
||||||
|
|
||||||
|
# Put a config/site.yml file in place since it's needed for operation
|
||||||
|
cp config/site.yml.tmpl config/site.yml
|
||||||
|
|
||||||
|
$docker_compose build
|
||||||
|
$docker_compose up -d
|
||||||
|
sleep 2 # janky way of waiting for the database to be up
|
||||||
|
|
||||||
|
# Leaving this in since it will be needed for Rails 5
|
||||||
|
# bin/rails db:environment:set RAILS_ENV=test || true
|
||||||
|
|
||||||
|
bin/rake db:create db:test:prepare
|
||||||
|
|
||||||
|
bin/rake ci:lite
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue