~starkingdoms/starkingdoms

2a46e99bda154a3367c251b4c68ea64bad361d39 — c0repwn3r 2 years ago cb213f2
fix building web images
1 files changed, 10 insertions(+), 3 deletions(-)

M spacetime
M spacetime => spacetime +10 -3
@@ 177,9 177,16 @@ build_docker() {

swap_out_server_for() {
  echo "[*] Swapping out API server"
  sed -i'orig' "s/let api_server = \"http:\\/\\/localhost:8080\";/let api_server = \"https:\\/\\/api.$1.$2\";/" "$SCRIPT_DIR/client/index.html"
  sed -i'orig' "s/let api_server = \"http:\\/\\/localhost:8080\";/let api_server = \"https:\\/\\/api.${1}.${2}\";/" "$SCRIPT_DIR/client/index.html"
  echo "[*] Swapping out game server"
  sed -i "s/let servers = [\"localhost:3000\"];/let servers = [\"https:\\/\\/$1.$2\"];/" "$SCRIPT_DIR/client/index.html"
  sed -i "s/let servers = \[\"localhost:3000\"\];/let servers = [\"${1}.${2}\"];/" "$SCRIPT_DIR/client/index.html"
}

sub_swap_server() {
  swap_out_server_for "$1" "$2"
}
sub_reset_server() {
  mv client/index.htmlorig client/index.html
}

sub_build_docker_api() {


@@ 199,7 206,7 @@ sub_build_docker_web() {
}

sub_build_docker_web_stable() {
  swap_out_server_for "stable" "starkingdoms.io"
  swap_out_server_for "starkingdoms" "io"
  build_docker "web" "stable"
  mv "$SCRIPT_DIR/client/index.htmlorig" "$SCRIPT_DIR/client/index.html"
}