Skip to content

Commit

Permalink
chore: use docker for build
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Jan 27, 2020
1 parent c88f253 commit 553eb55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion script/docker-functions
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ function docker_build_bundle_base() {
}

function get_pact_broker_version() {
ruby -e "puts File.read('pact_broker/Gemfile.lock').match(/pact_broker \((.*)\)/)[1]"
docker run --rm -v ${PWD}/pact_broker/Gemfile.lock:/tmp/Gemfile.lock ruby:2.6.4-alpine ruby -e "puts File.read('/tmp/Gemfile.lock').match(/pact_broker \((.*)\)/)[1]"
}

function bundle_update_on_docker() {
rm -rf tmp/Gemfile.lock
docker run --rm -v ${PWD}/tmp:/tmp/shared pact_broker_bundle_base:latest sh -c "bundle update && cp Gemfile.lock /tmp/shared"
mv tmp/Gemfile.lock pact_broker/
}
4 changes: 1 addition & 3 deletions script/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -e

source script/docker-functions

rm -rf tmp
docker_build_bundle_base
docker run --rm -v ${PWD}/tmp:/tmp/bundle_update pact_broker_bundle_base:latest sh -c "bundle update && cp Gemfile.lock /tmp/bundle_update"
mv tmp/Gemfile.lock pact_broker/
bundle_update_on_docker

unset PACT_BROKER_DATABASE_HOST
unset PACT_BROKER_DATABASE_USERNAME
Expand Down

0 comments on commit 553eb55

Please sign in to comment.