#How can I disable a cron job on PR environment?

11 messages · Page 1 of 1 (latest)

frozen frigate
#

Project id: 8eeaf105-a438-44c0-9215-78f268bcf4a9.

hazy jewelBOT
#

Project ID: 8eeaf105-a438-44c0-9215-78f268bcf4a9

frozen frigate
#

[build]
builder = "DOCKERFILE"
dockerfilePath = "./cron/router-stats/Dockerfile"
watchPatterns = ["cron/", "packages/", "!/*.md", "bun.lockb", "package.json"]

[deploy]
cronSchedule = "0 * * * *"
region = "europe-west4"

[environments.pr.deploy]
cronSchedule = "null"

cronSchedule = ""

none works. They both still deploy the service

crimson halo
#

the service is still going to be deployed, just not as a cron service.

you would also need to overwrite the build and start commands to noop type commands so nothing is ever run

frozen frigate
#

or is there another way of excluding this service from existing on a PR environment?

crimson halo
crimson halo
frozen frigate
# crimson halo maybe you could base your pr env off of an env that doesnt have the cron service...

I tried doing this:
[build]
builder = "DOCKERFILE"
dockerfilePath = "./cron/router-stats/Dockerfile"
watchPatterns = ["cron/", "packages/", "!/.md", "bun.lockb", "package.json"]

[deploy]
cronSchedule = "0 * * *"
region = "europe-west4"

[environments.pr.deploy]
cronSchedule = ""
startCommand = "echo skipping service execution on PR environments"

This makes the container fail for some reason. Shouldn't it override the startCommand of the Docker entry point command ?

crimson halo
#

yes it should, why does it fail

#

but also, did you try my suggestion?