Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More changes to the docker setup for development
- Loading branch information
Matthew Vincent
committed
Oct 30, 2017
1 parent
ebac374
commit 264371b
Showing
5 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker-compose-wrapper down --rmi all -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,42 @@ | ||
#!/usr/bin/env ruby | ||
require 'pathname' | ||
#!/usr/bin/env bash | ||
set -e | ||
export PATH="$(dirname "$0")/../bin:$PATH" | ||
PURGE=0 | ||
BUILD_LOCAL=0 | ||
|
||
# path to your application root. | ||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | ||
while getopts ":pl" opt; do | ||
case $opt in | ||
p) | ||
PURGE=1 | ||
;; | ||
l) | ||
BUILD_LOCAL=1 | ||
;; | ||
\?) | ||
echo "Invalid option: -$OPTARG" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
Dir.chdir APP_ROOT do | ||
# This script is a starting point to setup your application. | ||
# Add necessary setup steps to this file: | ||
if [ "$PURGE" -eq 1 ]; then | ||
bin/purge | ||
fi | ||
|
||
puts "== Installing dependencies ==" | ||
system "gem install bundler --conservative" | ||
system "bundle check || bundle install" | ||
if [ "$BUILD_LOCAL" -eq 0 ]; then | ||
echo "== Pulling docker images ==" | ||
docker-compose-wrapper pull | ||
else | ||
echo "== Building docker images ==" | ||
docker-compose-wrapper -f docker-compose-build.yml build | ||
fi | ||
|
||
# puts "\n== Copying sample files ==" | ||
# unless File.exist?("config/database.yml") | ||
# system "cp config/database.yml.sample config/database.yml" | ||
# end | ||
echo "== Preparing database ==" | ||
docker-compose-wrapper run app bin/rake db:create db:setup db:seed | ||
|
||
puts "\n== Preparing database ==" | ||
system "bin/rake db:setup" | ||
echo "== Setting up Pow" | ||
test -h ~/.pow/rekrei && rm ~/.pow/rekrei | ||
echo "3000" > ~/.pow/rekrei | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system "rm -f log/*" | ||
system "rm -rf tmp/cache" | ||
|
||
puts "\n== Restarting application server ==" | ||
system "touch tmp/restart.txt" | ||
end | ||
echo "Web: http://rekrei.dev" | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker-compose-wrapper down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters