Z
Zerops4mo ago
minsomai

env in a string?

I want the PAYLOAD_PUBLIC_SERVER_URL to be dynamic for dev and prod environment, How to reference inside the string. Couldn't find anything in docs.
run:
crontab:
- command: "curl --location '${PAYLOAD_PUBLIC_SERVER_URL}/api/sessions/close-all' --header 'Content-Type: application/json'"
# timing: "0 0 * * *"
timing: "*/2 * * * *"
allContainers: false # Run on a single container
workingDir: "/var/www"
run:
crontab:
- command: "curl --location '${PAYLOAD_PUBLIC_SERVER_URL}/api/sessions/close-all' --header 'Content-Type: application/json'"
# timing: "0 0 * * *"
timing: "*/2 * * * *"
allContainers: false # Run on a single container
workingDir: "/var/www"
2 Replies
Aleš
Aleš4mo ago
it's just a standard interpolation, nothing to do with anything Zerops specific, try either
"curl --location \"${PAYLOAD_PUBLIC_SERVER_URL}/api/sessions/close-all\" --header 'Content-Type: application/json'"
"curl --location \"${PAYLOAD_PUBLIC_SERVER_URL}/api/sessions/close-all\" --header 'Content-Type: application/json'"
or
"curl --location '${PAYLOAD_PUBLIC_SERVER_URL}'/api/sessions/close-all --header 'Content-Type: application/json'"
"curl --location '${PAYLOAD_PUBLIC_SERVER_URL}'/api/sessions/close-all --header 'Content-Type: application/json'"
right, @Backend ?
minsomai
minsomaiOP4mo ago
thank you, checking

Did you find this page helpful?