Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
173 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
/vendor |
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 @@ | ||
2.4.1 |
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
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,67 @@ | ||
#!/bin/sh | ||
|
||
# script/bootstrap: Resolve all dependencies that the application requires to | ||
# run. | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
which rvm >/dev/null 2>&1 && { | ||
echo "Sorry, $0 can not be used with rvm." | ||
exit 1 | ||
} | ||
|
||
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then | ||
brew bundle check >/dev/null 2>&1 || { | ||
echo "==> Installing Homebrew dependencies…" | ||
brew bundle | ||
} | ||
elif [ "$(uname -s)" = "Linux" ] && [ -f "/etc/debian_version" ]; then | ||
|
||
# Install rbenv if needed | ||
which rbenv >/dev/null 2>&1 || { | ||
echo "==> Installing Dependencie -- rbenv" | ||
sudo apt-get update && sudo apt-get install -y autoconf bison build-essential \ | ||
libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev | ||
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | ||
cd ~/.rbenv && src/configure && make -C src | ||
grep 'export PATH="$HOME/.rbenv/bin:$PATH"' ~/.bashrc > /dev/null 2>&1 || { | ||
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | ||
} | ||
grep 'eval "$(rbenv init -)"' ~/.bashrc > /dev/null 2>&1 || { | ||
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | ||
} | ||
export PATH="$HOME/.rbenv/bin:$PATH" | ||
eval "$(rbenv init -)" | ||
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build | ||
} | ||
|
||
# Install docker if needed | ||
which docker >/dev/null 2>&1 || { | ||
echo "==> Installing Dependencie -- docker" | ||
sudo apt-get update && sudo apt-get install docker.io -y | ||
sudo usermod -aG docker $USER | ||
newgrp docker | ||
} | ||
|
||
else | ||
echo "Sorry, only support macOS & Debain system." | ||
exit 1 | ||
fi | ||
|
||
if [ -f ".ruby-version" ] && [ -z "$(rbenv version-name 2>/dev/null)" ]; then | ||
echo "==> Installing Ruby…" | ||
rbenv install --skip-existing | ||
which bundle >/dev/null 2>&1 || { | ||
gem install bundler | ||
rbenv rehash | ||
} | ||
fi | ||
|
||
if [ -f "Gemfile" ]; then | ||
echo "==> Installing gem dependencies…" | ||
bundle check --path vendor/gems >/dev/null 2>&1 || { | ||
bundle install --path vendor/gems --quiet --without production | ||
} | ||
fi |
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,15 @@ | ||
#!/bin/sh | ||
|
||
# script/console: Launch a console for the application. Optionally allow an | ||
# environment to be passed in to let the script handle the | ||
# specific requirements for connecting to a console for that | ||
# environment. | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
# no argument provided, so just run the local console in the development | ||
# environment. Ensure the application is setup first. | ||
script/setup | ||
bin/console |
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,21 @@ | ||
#!/bin/sh | ||
|
||
# script/setup: Set up application for the first time after cloning, or set it | ||
# back to the initial first unused state. | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
script/bootstrap | ||
|
||
|
||
if [ -z `docker images -q zhenkyle/docker-sslocal` ]; then | ||
docker pull zhenkyle/docker-sslocal | ||
fi | ||
|
||
if [ -z `docker images -q zhenkyle/shadowsocksr` ]; then | ||
docker pull zhenkyle/shadowsocksr | ||
fi | ||
|
||
echo "==> App is now ready to go!" |
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,23 @@ | ||
#!/bin/sh | ||
|
||
# script/test: Run test suite for application. Optionally pass in a path to an | ||
# individual test file to run a single test. | ||
|
||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
[ -z "$DEBUG" ] || set -x | ||
|
||
script/setup | ||
|
||
echo "==> Running tests…" | ||
|
||
if [ -n "$1" ]; then | ||
# pass arguments to test call. This is useful for calling a single test. | ||
echo "use: bin/rspec $1" | ||
echo " or: bin/cucumber $1" | ||
else | ||
bin/rake test | ||
fi |