Move build step into own script (#27)

... so it works when deploying and running the tests.
This commit is contained in:
Helge Rausch
2022-12-02 14:05:42 +01:00
committed by GitHub
parent 9b1ed05a5f
commit 753f5b9ca8
3 changed files with 17 additions and 9 deletions

11
bin/build Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
snpr_rev="$SNPR_REV"
if [ -z "$snpr_rev" ]; then
snpr_rev=$(git ls-remote https://github.com/opensnp/snpr master | cut -f 1)
fi
docker-compose build --build-arg SNPR_REV=$snpr_rev rails
docker-compose build sidekiq

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
set -x
bin/build
docker login
docker push opensnp/rails
docker push opensnp/rails-sidekiq

View File

@@ -2,14 +2,8 @@
set -x
snpr_rev="$SNPR_REV"
if [ -z "$snpr_rev" ]; then
snpr_rev=$(git ls-remote https://github.com/opensnp/snpr master | cut -f 1)
fi
bin/build
docker-compose kill
docker-compose rm rails sidekiq
docker-compose build --build-arg SNPR_REV=$snpr_rev rails sidekiq
docker-compose up -d
docker-compose exec rails bash -l -c 'bundle exec rake db:reset'