When writing scripts, you may want to reuse variables, or safely pass secrets to scripts. You can do that with Variables. getOperate has user-defined variables and contextual variables.
pg: Postgresql
is only going to
offer a selection over the resources of type postgresql in the auto-generated UI).
There is also a concept of state to share values
across script executions.
Contextual
tab on the Variable page for the list of reserved variables and what they are used for.
You can use them in a Script by clicking on “+Context Var”:
Name | Value |
---|---|
GOPRT_WORKSPACE | Workspace id of the current script |
GOPRT_TOKEN | Token ephemeral to the current script with equal permission to the permission of the run (Usable as a bearer token) |
GOPRT_EMAIL | Email of the user that executed the current script |
GOPRT_USERNAME | Username of the user that executed the current script |
GOPRT_BASE_URL | Base URL of this instance |
GOPRT_JOB_ID | Job id of the current script |
GOPRT_JOB_PATH | Path of the script or flow being run if any |
GOPRT_FLOW_JOB_ID | Job id of the encapsulating flow if the job is a flow step |
GOPRT_FLOW_PATH | Path of the encapsulating flow if the job is a flow step |
GOPRT_SCHEDULE_PATH | Path of the schedule if the job of the step or encapsulating step has been triggered by a schedule |
GOPRT_PERMISSIONED_AS | Fully Qualified (u/g) owner name of executor of the job |
GOPRT_STATE_PATH | State resource path unique to a script and its trigger |
u/alice/secret
will only be accessible by alice
,
unless explicitly shared. A secret in f/devops/secret
will be accessible by anyone with read access to f/devops
.print
a secret if they have access to it from a script.variables.decrypt_secret
event that ends up in
the Audit Logs. It means that you can audit who accesses secrets. Additionally you can audit results, logs and
script code for every script run.Contextual
tab on the Variable page for the list of reserved variables and what they are used for.
You can use them in a Script by clicking on “+Context Var”:
Reserved variables are passed to the job as environment variables. For example, the ephemeral token is passed as GOPRT_TOKEN
.
$var:<variable_path>
and replaced by the worker at time of execution of the script by fetching the value with the job’s permissions. So the job will fail if the job’s permissions inherited from the caller do not allow access to the variable. This is the same mechanism used for resource, but they use $res:
instead of $var:
.
+ Variable
, you’ll get to pick a variable from your workspace and be able to fetch it from within the script.
Typescript: