~starkingdoms/starkingdoms

d29a89aeb29a853e1f2856912076fa7efaaaae46 — c0repwn3r 2 years ago 27a49e0
add stable build commands
1 files changed, 30 insertions(+), 0 deletions(-)

M spacetime
M spacetime => spacetime +30 -0
@@ 40,6 40,10 @@ sub_help() {
  echo "    clean - Remove all generated files" # done
  echo "    build_docker_api - Build the API dockerfile" # done
  echo "    build_docker_server - Build the server dockerfile" # done
  echo "    build_docker - Build the API and server containers" # done
  echo "    build_docker_api_stable - Build the API container and push it as api-stable" # done
  echo "    build_docker_server_stable - Build the server container and push it as server-stable" # done
  echo "    build_docker_stable - Build the stable api and server containers" # done
}

check_install_cargo() {


@@ 82,6 86,32 @@ sub_build_docker_server() {
  docker push registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:server-bleeding
}

sub_build_docker_api_stable() {
  cargo build --release --bin starkingdoms-api
  docker buildx build -f api.Dockerfile -t registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:api-$(git rev-parse --short HEAD) .
  docker buildx build -f api.Dockerfile -t registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:api-stable .
  docker push registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:api-$(git rev-parse --short HEAD)
  docker push registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:api-stable
}

sub_build_docker_server() {
  cargo build --release --bin starkingdoms-server
  docker buildx build -f server.Dockerfile -t registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:server-$(git rev-parse --short HEAD) .
  docker buildx build -f server.Dockerfile -t registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:server-stable .
  docker push registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:server-$(git rev-parse --short HEAD)
  docker push registry.gitlab.com/starkingdoms.tk/starkingdoms.tk:server-stable
}

sub_build_docker() {
  sub_build_docker_api
  sub_build_docker_server
}

sub_build_docker_stable() {
  sub_build_docker_api_stable
  sub_build_docker_server_stable
}

sub_clean() {
  rm -rf web/dist
  rm -rf assets/dist