Created
September 5, 2017 07:54
-
-
Save amaierhofer/f8d68b8fc6f9651379fc331a48fc6d0f to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
ROOT=~/dev/pzl/hitobito | |
RUBY_VERSION=2.1.5 | |
link() { | |
echo "linking $1 -> $2" | |
ln -s "$1" "$2" | |
} | |
target=$1 | |
if [ -z "$target" ]; then | |
echo "$_ <cevi|pbs|jubla|generic>" | |
exit 0 | |
fi | |
# core | |
echo PATH_add bin > $ROOT/hitobito/.envrc | |
echo export RAILS_DB_NAME=db/"$target"/development.sqlite3 >> $ROOT/hitobito/.envrc | |
echo export RAILS_TEST_DB_NAME=db/"$target"/test.sqlite3 >>$ROOT/hitobito/.envrc | |
echo export RAILS_PRODUCTION_DB_NAME=db/"$target"/production.sqlite3 >>$ROOT/hitobito/.envrc | |
echo export RAILS_TARGET=$target >> $ROOT/hitobito/.envrc | |
if [ "$target" = "jubla" ]; then | |
echo export WAGONS=\"youth "$target" "$target"_ci\" >> $ROOT/hitobito/.envrc | |
else | |
echo export WAGONS=\"youth "$target"\" >> $ROOT/hitobito/.envrc | |
fi | |
echo $RUBY_VERSION > $ROOT/hitobito/.ruby-version | |
cd $ROOT/hitobito && git update-index --assume-unchanged .ruby-version | |
# wagon | |
echo export RAILS_DB_NAME=db/"$target"/development.sqlite3 > "$ROOT/hitobito_$target/.envrc" | |
echo export RAILS_TEST_DB_NAME=db/"$target"/test.sqlite3 >> "$ROOT/hitobito_$target/.envrc" | |
echo export RAILS_PRODUCTION_DB_NAME=db/"$target"/production.sqlite3 >> "$ROOT/hitobito_$target/.envrc" | |
if [ "$target" = "jubla" ]; then | |
echo export WAGONS="youth $target $target"_ci >> "$ROOT/hitobito_$target/.envrc" | |
else | |
echo export WAGONS="youth $target" >> "$ROOT/hitobito_$target/.envrc" | |
fi | |
echo $RUBY_VERSION > "$ROOT/hitobito_$target/.ruby-version" | |
cd "$ROOT/hitobito_$target" && git update-index --assume-unchanged .ruby-version | |
rm -rf $ROOT/hitobito/tmp/* | |
cd $ROOT/hitobito |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment