Skip to content

Commit a7a11d4

Browse files
committed
feat: provider configs in scripts folder
1 parent eb1501a commit a7a11d4

File tree

4 files changed

+41
-29
lines changed

4 files changed

+41
-29
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Enable run plugin
4+
taito_plugins="
5+
run:-local
6+
${taito_plugins}
7+
"
8+
run_scripts_location="scripts/custom-provider"
9+
10+
# Do not use Docker, Kubernetes and Helm on remote environments
11+
taito_plugins="${taito_plugins/docker /docker:local }"
12+
taito_plugins="${taito_plugins/kubectl:-local/}"
13+
taito_plugins="${taito_plugins/helm:-local/}"

scripts/linux-provider/_config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
echo "[Configuration]"
44
echo "- Using sudo: ${LINUX_SUDO}"
55
echo "- Client max body size: ${LINUX_CLIENT_MAX_BODY_SIZE}"
6-
echo "NOTE: You can configure these in taito-config.sh"
6+
echo "You can configure these in scripts/linux-provider/taito-provider-config.sh"
77
echo
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Enable ssh and run plugins
4+
taito_plugins="
5+
ssh:-local
6+
run:-local
7+
${taito_plugins}
8+
"
9+
run_scripts_location="scripts/linux-provider"
10+
11+
# Set some configuration parameters for scripts/linux-provider scripts
12+
LINUX_SUDO=sudo # NOTE: Put empty value if sudo is not required or allowed
13+
LINUX_CLIENT_MAX_BODY_SIZE=1m
14+
15+
# Use Docker Compose instead of Kubernetes and Helm
16+
taito_plugins="${taito_plugins/docker-compose:local/docker-compose}"
17+
taito_plugins="${taito_plugins/kubectl:-local/}"
18+
taito_plugins="${taito_plugins/helm:-local/}"
19+
20+
# Use SSH plugin as database proxy
21+
export ssh_db_proxy="\
22+
-L 0.0.0.0:\${database_port}:\${database_host}:\${database_real_port} \${taito_ssh_user}@\${database_real_host}"
23+
export ssh_forward_for_db="${ssh_db_proxy}"

taito-provider-config.sh

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,12 @@ case $taito_provider in
4242
gcp_service_account_enabled=true
4343
;;
4444
linux)
45-
# Enable ssh and run plugins
46-
taito_plugins="
47-
ssh:-local
48-
run:-local
49-
${taito_plugins}
50-
"
51-
run_scripts_location="scripts/linux-provider"
52-
# Set some configuration parameters for scripts/linux-provider scripts
53-
LINUX_SUDO=sudo # NOTE: Put empty value if sudo is not required or allowed
54-
LINUX_CLIENT_MAX_BODY_SIZE=1m
55-
# Use Docker Compose instead of Kubernetes and Helm
56-
taito_plugins="${taito_plugins/docker-compose:local/docker-compose}"
57-
taito_plugins="${taito_plugins/kubectl:-local/}"
58-
taito_plugins="${taito_plugins/helm:-local/}"
59-
# Use SSH plugin as database proxy
60-
export ssh_db_proxy="\
61-
-L 0.0.0.0:\${database_port}:\${database_host}:\${database_real_port} \${taito_ssh_user}@\${database_real_host}"
62-
export ssh_forward_for_db="${ssh_db_proxy}"
45+
# shellcheck disable=SC1091
46+
. scripts/linux-provider/taito-provider-config.sh
6347
;;
6448
custom)
65-
# Enable run plugin
66-
taito_plugins="
67-
run:-local
68-
${taito_plugins}
69-
"
70-
run_scripts_location="scripts/custom-provider"
71-
# Do not use Docker, Kubernetes and Helm on remote environments
72-
taito_plugins="${taito_plugins/docker /docker:local }"
73-
taito_plugins="${taito_plugins/kubectl:-local/}"
74-
taito_plugins="${taito_plugins/helm:-local/}"
49+
# shellcheck disable=SC1091
50+
. scripts/custom-provider/taito-provider-config.sh
7551
;;
7652
esac
7753

0 commit comments

Comments
 (0)