File tree Expand file tree Collapse file tree 6 files changed +28
-14
lines changed Expand file tree Collapse file tree 6 files changed +28
-14
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " [Configuration]"
4+ echo " - Using sudo: ${LINUX_SUDO} "
5+ echo " - Client max body size: ${LINUX_CLIENT_MAX_BODY_SIZE} "
6+ echo " NOTE: You can configure these in taito-config.sh"
7+ echo
Original file line number Diff line number Diff line change 1212
1313set -e
1414
15+ . " ${taito_project_path} /scripts/linux-provider/_config.sh"
16+ . " ${taito_cli_path} /plugins/ssh/util/opts.sh"
17+
1518image_tag=$1
1619if [[ ! $image_tag ]]; then
1720 echo " [Getting commit sha of the latest commit on branch ${taito_branch} ]"
@@ -30,8 +33,6 @@ echo "NOTE: Deployment is done using the taito-config.sh and"
3033echo " docker-compose-remote.yaml currently located on your local directory."
3134echo
3235
33- . " ${taito_cli_path} /plugins/ssh/util/opts.sh"
34-
3536echo " [Copy docker-compose-remote.yaml to ${taito_host} :/tmp]"
3637(
3738 set -e
4546
4647echo " [Execute on host ${taito_host} ]"
4748ssh ${opts} " ${taito_ssh_user} @${taito_host} " "
48- sudo bash -c '
49+ ${LINUX_SUDO} bash -c '
4950 set -e
5051 ${taito_setv:? }
5152 cd ${taito_host_dir}
5253 echo
5354 echo [Check that Docker images exist]
54- if ! sudo docker images | grep ${taito_container_registry} | grep ${image_tag} &> /dev/null; then
55+ if ! docker images | grep ${taito_container_registry} | grep ${image_tag} &> /dev/null; then
5556 echo Latest images on remote host:
56- sudo docker images | grep ${taito_container_registry}
57+ docker images | grep ${taito_container_registry}
5758 echo
5859 echo ERROR: No image with tag ${image_tag}
5960 exit 1
Original file line number Diff line number Diff line change 99
1010set -e
1111
12- CLIENT_MAX_BODY_SIZE=1m
13-
12+ . " ${taito_project_path} /scripts/linux-provider/_config.sh"
1413. " ${taito_cli_path} /plugins/ssh/util/opts.sh"
1514
1615echo " [Copy changed secrets to ${taito_host} :/tmp]"
2625
2726echo " [Execute on ${taito_host} ]"
2827ssh ${opts} " ${taito_ssh_user} @${taito_host} " "
29- sudo bash -c '
28+ ${LINUX_SUDO} bash -c '
3029 set -e
3130 ${taito_setv:? }
3231 echo [Extract /tmp/${taito_namespace} -secrets.tar]
@@ -36,7 +35,7 @@ ssh ${opts} "${taito_ssh_user}@${taito_host}" "
3635 echo
3736
3837 if which createtaitosite &> /dev/null; then
39- createtaitosite ${taito_namespace} ${taito_domain} $CLIENT_MAX_BODY_SIZE
38+ createtaitosite ${taito_namespace} ${taito_domain} $LINUX_CLIENT_MAX_BODY_SIZE
4039 else
4140 echo NOTE: createtaitosite command does not exist.
4241 echo Configure routing for domain ${taito_domain} yourself.
Original file line number Diff line number Diff line change 77
88set -e
99
10+ . " ${taito_project_path} /scripts/linux-provider/_config.sh"
1011. " ${taito_cli_path} /plugins/ssh/util/opts.sh"
1112
1213echo " [Execute on ${taito_host} ]"
1314ssh ${opts} " ${taito_ssh_user} @${taito_host} " "
14- sudo bash -c '
15+ ${LINUX_SUDO} bash -c '
1516 set -e
1617 ${taito_setv:? }
1718 if which deletetaitosite &> /dev/null; then
Original file line number Diff line number Diff line change 88
99set -e
1010
11+ . " ${taito_project_path} /scripts/linux-provider/_config.sh"
1112. " ${taito_cli_path} /plugins/ssh/util/opts.sh"
1213
13- # TODO: duplicate code with taito-env-apply#post.sh
14+ # TODO: some duplicate code with taito-env-apply#post.sh
1415
1516echo " [Copy changed secrets to ${taito_host} :/tmp]"
1617(
2526
2627echo " [Execute on ${taito_host} ]"
2728ssh ${opts} " ${taito_ssh_user} @${taito_host} " "
28- sudo bash -c '
29+ ${LINUX_SUDO} bash -c '
2930 set -e
3031 ${taito_setv:? }
3132 echo [Extract /tmp/${taito_namespace} -secrets.tar]
@@ -36,6 +37,7 @@ ssh ${opts} "${taito_ssh_user}@${taito_host}" "
3637
3738 echo [Restart docker-compose]
3839 cd ${taito_host_dir}
40+ . taito-config.sh
3941 docker-compose stop
4042 docker-compose -d up
4143 '
Original file line number Diff line number Diff line change @@ -359,17 +359,21 @@ case $taito_provider in
359359 gcloud_service_account_enabled=true
360360 ;;
361361 linux)
362+ # Enable ssh and run plugins
362363 taito_plugins="
363364 ssh:-local
364365 run:-local
365366 ${taito_plugins}
366367 "
367368 run_scripts_location=" scripts/linux-provider"
368- # Use docker-compose instead of Kubernetes and Helm
369+ # Set some configuration parameters for scripts/linux-provider scripts
370+ LINUX_SUDO=sudo # NOTE: Put empty value if sudo is not required or allowed
371+ LINUX_CLIENT_MAX_BODY_SIZE=1m
372+ # Use Docker Compose instead of Kubernetes and Helm
369373 taito_plugins=" ${taito_plugins/ docker-compose: local/ docker-compose} "
370374 taito_plugins=" ${taito_plugins/ kubectl:- local/ } "
371375 taito_plugins=" ${taito_plugins/ helm:- local/ } "
372- # ssh plugin as database proxy
376+ # Use SSH plugin as database proxy
373377 if [[ -f taito-user-config.sh ]]; then
374378 . ./taito-user-config.sh # TODO: hack
375379 fi
You can’t perform that action at this time.
0 commit comments