Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use separate db for wagon test env #59

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions bin/test_env_wagon
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail

source $(dirname $0)/_basics
SCRIPT_PATH="$(dirname $0)"
source "$SCRIPT_PATH/_basics"

WAGONS=($SCRIPT_PATH/../app/hitobito_*)
# Remove prefix
WAGONS=("${WAGONS[@]//$SCRIPT_PATH\/..\/app\/hitobito_/}")

echo "${WAGONS[@]}"
#echo "${WAGONS_2[@]}"
#echo "${WAGONS[@]//$SCRIPT_PATH\/..\/app\/hitobito_}"

WAGON="${1:-${WAGON:-}}"
echo $WAGON

if [[ ! " ${WAGONS[@]} " =~ " ${WAGON:-} " ]]; then
echo 'select a wagon'
PS3="Enter a number: "
select WAGON in ${WAGONS[@]} ; do
echo selected $WAGON
break
done

echo $WAGON selected with ${REPLY}
fi


echo would use $WAGON selected

exit 0

docker-compose run --rm \
--workdir=/usr/src/app/hitobito_$WAGON \
-e RAILS_ENV=test \
rails \
bundle exec bash "$@"