##// END OF EJS Templates
feat(dev-tools): added svnd command
super-admin -
Show More
@@ -1559,10 +1559,61 b' dev_tools_svn_command() {'
1559 # :command.function
1559 # :command.function
1560 dev_tools_svnd_command() {
1560 dev_tools_svnd_command() {
1561 # src/svnd_command.sh
1561 # src/svnd_command.sh
1562 echo "# this file is located in 'src/svnd_command.sh'"
1562 if [[ -v WORKSPACE_HOME ]];
1563 echo "# code for 'dev-tools svnd' goes here"
1563 then
1564 echo "# you can edit it freely and regenerate (it will not be overwritten)"
1564 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1565 inspect_args
1565 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1566 else
1567 echo "WORKSPACE_HOME env var is not set"
1568 exit 1
1569 fi
1570
1571 code_workdir=${args[--workdir]}
1572 cmd_script=${args[--cmd]}
1573
1574 exec_script=$WORKSPACE_HOME/$cmd_script
1575 container_name=dev-svnd
1576 env_file=".custom/.dev.env"
1577
1578 echo "Using exec script: $exec_script"
1579
1580 RC_DEV_CMD_HELP=""
1581
1582 if [[ ! -f $exec_script ]]; then
1583 echo "Generating new $exec_script file..."
1584 mkdir -p $(dirname $exec_script)
1585
1586 cat <<< "
1587 # Generated dev-env script for svn
1588
1589 echo \"Run svn dev using the following command:\"
1590 make dev-env && apachectl -D FOREGROUND
1591 " > $exec_script
1592 chmod +x $exec_script
1593 fi
1594
1595 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1596
1597 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-svnd")
1598
1599 if [[ $docker_id ]]; then
1600 echo $container_name FOUND, Killing old one !
1601 docker kill -s 9 $docker_id
1602 sleep 5
1603 docker rm -fv $container_name
1604 echo "done..."
1605 else
1606 echo $container_name not found
1607 fi
1608
1609 eval "
1610 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1611 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1612 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1613 --workdir=\"$code_workdir\" \
1614 --name=\"$container_name\" \
1615 --detach \
1616 svn $docker_exec_script"
1566
1617
1567 }
1618 }
1568
1619
General Comments 0
You need to be logged in to leave comments. Login now