Add yarn command to the diaspora-dev docker script

This commit is contained in:
Benjamin Neff 2022-07-21 22:44:03 +02:00
parent 95a9c329af
commit fdcea3e824
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -78,8 +78,11 @@ print_usage() {
;; ;;
bundle) bundle)
echo; echo "Install gems using bundle into $DIASPORA_ROOT" echo; echo "Install gems using bundle into $DIASPORA_ROOT"
print_usage_header "bundle [options]" \ print_usage_header "bundle"
"-d Run in background" ;;
yarn)
echo; echo "Install frontend dependencies using yarn into $DIASPORA_ROOT"
print_usage_header "yarn"
;; ;;
config) config)
echo; echo "Create basic configuration files for usage with PostgreSQL (default)" echo; echo "Create basic configuration files for usage with PostgreSQL (default)"
@ -151,6 +154,7 @@ print_usage_full() {
echo "Misc. Commands:" echo "Misc. Commands:"
echo " build Build basic diaspora* environment" echo " build Build basic diaspora* environment"
echo " bundle (Re-)Install gems for diaspora*" echo " bundle (Re-)Install gems for diaspora*"
echo " yarn (Re-)Install frontend dependencies for diaspora*"
echo " config Configure diaspora*" echo " config Configure diaspora*"
echo " exec Execute a command in the run environment (advanced)" echo " exec Execute a command in the run environment (advanced)"
echo " help Show help for commands" echo " help Show help for commands"
@ -223,12 +227,19 @@ dia_bundle() {
echo "Installing gems via bundler ..." echo "Installing gems via bundler ..."
dia_docker_compose run \ dia_docker_compose run \
--rm \ --rm \
--no-deps $1 \ --no-deps \
-e DIA_NODB=1 \ -e DIA_NODB=1 \
diaspora \ diaspora \
/bin/sh -c "gem install bundler && script/configure_bundler && bin/bundle install --full-index" /bin/sh -c "gem install bundler && script/configure_bundler && bin/bundle install --full-index"
} }
dia_yarn() {
# Run yarn in order to install all frontend dependencies into $DIASPORA_ROOT
# Do not start database, not required and sometimes not yet configured
echo "Installing frontend dependencies via yarn ..."
dia_docker_compose run --rm --no-deps -e DIA_NODB=1 diaspora bin/yarn
}
dia_clean() { dia_clean() {
# Delete all containers and volumes # Delete all containers and volumes
for i in "$@"; do for i in "$@"; do
@ -524,7 +535,7 @@ case "$dia_command" in
dia_build "$@" dia_build "$@"
;; ;;
bundle) bundle)
dia_bundle "$1" dia_bundle
;; ;;
clean) clean)
dia_clean "$@" dia_clean "$@"
@ -574,6 +585,9 @@ case "$dia_command" in
stop) stop)
dia_stop dia_stop
;; ;;
yarn)
dia_yarn
;;
*) *)
print_usage print_usage
exit 1 exit 1