diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2022-07-21 23:42:37 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2022-07-22 00:24:55 +0300 |
commit | 95a9c329af35ab5a780476e0642215f14f017052 (patch) | |
tree | 40c689b79727b828ebf46cd1bfcd913a069e156d /script | |
parent | 08e6f1e2a3ca7dce60f2e62a7133528f1cd3049f (diff) |
Add command for bin/setup to the diaspora-dev docker script
and also use it for the initial setup command, so it also install yarn
dependencies
Diffstat (limited to 'script')
-rwxr-xr-x | script/diaspora-dev | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/script/diaspora-dev b/script/diaspora-dev index e625524fe..c7ac127c6 100755 --- a/script/diaspora-dev +++ b/script/diaspora-dev @@ -98,6 +98,10 @@ print_usage() { echo; echo "Show help on a command" print_usage_header "help COMMAND" ;; + setup-rails) + echo; echo "Set up development environment (install dependencies, migrate db, ...)" + print_usage_header "setup-rails" + ;; setup-tests) echo; echo "Prepare cached files and database contents for tests" print_usage_header "setup-tests" @@ -150,6 +154,7 @@ print_usage_full() { echo " config Configure diaspora*" echo " exec Execute a command in the run environment (advanced)" echo " help Show help for commands" + echo " setup-rails Prepare diaspora* development environment (install dependencies, migrate db)" echo " setup-tests Prepare diaspora* test environment" echo echo "Run '$SCRIPT_NAME help COMMAND' for more information on a command." @@ -423,14 +428,23 @@ dia_setup() { set -e dia_build $build dia_config $config - dia_bundle $bundle - dia_migrate $migrate - dia_setup_tests $setup_tests + dia_bundle + dia_setup_rails + dia_setup_tests ) # stop db afterwards as it is not needed while dia is not running dia_docker_compose stop $DIASPORA_DOCKER_DB } +dia_setup_rails() { + # Prepare rails, install dependencies, migrate database, ... + # stop db if it was not running before + echo "Setting up environment for tests ..." + if ! dia_is_db_running; then stopdb="dia_docker_compose stop $DIASPORA_DOCKER_DB"; fi + dia_docker_compose run --rm diaspora bin/setup + $stopdb +} + dia_setup_tests() { # Prepare all possible tests # stop db if it was not running before @@ -545,6 +559,9 @@ case "$dia_command" in setup) dia_setup "$@" ;; + setup-rails) + dia_setup_rails + ;; setup-tests) dia_setup_tests ;; |