diff --git a/Containerfile b/Containerfile index 2ed48b613..98cc4266d 100644 --- a/Containerfile +++ b/Containerfile @@ -52,6 +52,7 @@ COPY --from=cache /build/ /usr/src/shuttle/ FROM shuttle-common ARG folder ARG prepare_args +ARG PROD COPY ${folder}/prepare.sh /prepare.sh RUN /prepare.sh "${prepare_args}" ARG CARGO_PROFILE diff --git a/Makefile b/Makefile index 9135b5224..edc69e5fc 100644 --- a/Makefile +++ b/Makefile @@ -163,6 +163,7 @@ shuttle-%: ${SRC} Cargo.lock --build-arg PROTOC_ARCH=$(PROTOC_ARCH) \ --build-arg folder=$(*) \ --build-arg prepare_args=$(PREPARE_ARGS) \ + --build-arg PROD=$(PROD) \ --build-arg RUSTUP_TOOLCHAIN=$(RUSTUP_TOOLCHAIN) \ --build-arg CARGO_PROFILE=$(CARGO_PROFILE) \ --tag $(CONTAINER_REGISTRY)/$(*):$(COMMIT_SHA) \ diff --git a/deployer/prepare.sh b/deployer/prepare.sh index 09b6a2b09..5433149c9 100755 --- a/deployer/prepare.sh +++ b/deployer/prepare.sh @@ -6,29 +6,33 @@ ############################################################################### # Patch crates to be on same versions -mkdir -p $CARGO_HOME; \ -echo '[patch.crates-io] -shuttle-service = { path = "/usr/src/shuttle/service" } -shuttle-runtime = { path = "/usr/src/shuttle/runtime" } - -shuttle-aws-rds = { path = "/usr/src/shuttle/resources/aws-rds" } -shuttle-persist = { path = "/usr/src/shuttle/resources/persist" } -shuttle-shared-db = { path = "/usr/src/shuttle/resources/shared-db" } -shuttle-secrets = { path = "/usr/src/shuttle/resources/secrets" } -shuttle-static-folder = { path = "/usr/src/shuttle/resources/static-folder" } - -shuttle-axum = { path = "/usr/src/shuttle/services/shuttle-axum" } -shuttle-actix-web = { path = "/usr/src/shuttle/services/shuttle-actix-web" } -shuttle-next = { path = "/usr/src/shuttle/services/shuttle-next" } -shuttle-poem = { path = "/usr/src/shuttle/services/shuttle-poem" } -shuttle-poise = { path = "/usr/src/shuttle/services/shuttle-poise" } -shuttle-rocket = { path = "/usr/src/shuttle/services/shuttle-rocket" } -shuttle-salvo = { path = "/usr/src/shuttle/services/shuttle-salvo" } -shuttle-serenity = { path = "/usr/src/shuttle/services/shuttle-serenity" } -shuttle-thruster = { path = "/usr/src/shuttle/services/shuttle-thruster" } -shuttle-tide = { path = "/usr/src/shuttle/services/shuttle-tide" } -shuttle-tower = { path = "/usr/src/shuttle/services/shuttle-tower" } -shuttle-warp = { path = "/usr/src/shuttle/services/shuttle-warp" }' > $CARGO_HOME/config.toml +mkdir -p $CARGO_HOME +if [[ $PROD != "true" ]]; then + echo '[patch.crates-io] + shuttle-service = { path = "/usr/src/shuttle/service" } + shuttle-runtime = { path = "/usr/src/shuttle/runtime" } + + shuttle-aws-rds = { path = "/usr/src/shuttle/resources/aws-rds" } + shuttle-persist = { path = "/usr/src/shuttle/resources/persist" } + shuttle-shared-db = { path = "/usr/src/shuttle/resources/shared-db" } + shuttle-secrets = { path = "/usr/src/shuttle/resources/secrets" } + shuttle-static-folder = { path = "/usr/src/shuttle/resources/static-folder" } + + shuttle-axum = { path = "/usr/src/shuttle/services/shuttle-axum" } + shuttle-actix-web = { path = "/usr/src/shuttle/services/shuttle-actix-web" } + shuttle-next = { path = "/usr/src/shuttle/services/shuttle-next" } + shuttle-poem = { path = "/usr/src/shuttle/services/shuttle-poem" } + shuttle-poise = { path = "/usr/src/shuttle/services/shuttle-poise" } + shuttle-rocket = { path = "/usr/src/shuttle/services/shuttle-rocket" } + shuttle-salvo = { path = "/usr/src/shuttle/services/shuttle-salvo" } + shuttle-serenity = { path = "/usr/src/shuttle/services/shuttle-serenity" } + shuttle-thruster = { path = "/usr/src/shuttle/services/shuttle-thruster" } + shuttle-tide = { path = "/usr/src/shuttle/services/shuttle-tide" } + shuttle-tower = { path = "/usr/src/shuttle/services/shuttle-tower" } + shuttle-warp = { path = "/usr/src/shuttle/services/shuttle-warp" }' > $CARGO_HOME/config.toml +else + touch $CARGO_HOME/config.toml +fi # Add the wasm32-wasi target rustup target add wasm32-wasi