Environment variables
Add, change and remove the variables a CoreStack Enterprise environment's deployments read.
Before you start
- You can open the environment: see Websites and environments.
- Each environment has its own variables, up to 100.
- The deployment pipeline reads a variable under its name with
CF_in front:NPM_TOKENis read asCF_NPM_TOKEN.
Add a variable
Open Environment Variables
Open the environment, choose Deployments and find Environment Variables.
Enter the key and value
Choose Add environment variable. Enter the key, using letters, digits and underscores and starting with a letter or an underscore, then the value, of up to 2,048 characters.
Save
Choose Save on the row.
The next deployment reads the variable. A saved value is masked: choose Show to read it.
Change or remove a variable
Edit the row
Change the key or enter a new value, then choose Save on the row. To delete the variable, choose Remove and confirm.
The change takes effect from the next deployment.
Automate this
Creates the variable when the environment does not have it (201), and changes it otherwise (200).
curl -X PUT https://manage.corefinity.com/api/environments/1311/variables/API_TOKEN \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"value": "example-value-not-a-real-secret"
}'Your assistant calls corestack_enterprise_variable_set.
{
"name": "corestack_enterprise_variable_set",
"arguments": {
"enterprise_env_id": 1530,
"name": "API_URL",
"value": "https://api.example.com"
}
}