Selects an set of environment variable prefix depending on the condition.
select-env [FLAGS]
CLI
Flag / Environment | Description | Type | Required | Default |
---|---|---|---|---|
$LOG_LEVEL |
Define the log level for the application. | String enum("panic", "fatal", "warn", "info", "debug", "trace") |
false |
info |
$ENV_FILE |
Environment files to inject. | StringSlice |
false |
Environment
Flag / Environment | Description | Type | Required | Default |
---|---|---|---|---|
$ENVIRONMENT_CONDITIONS |
Regex pattern to select an environment. Use either "heads/" for narrowing the search to branches or "tags/" for narrowing the search to tags. |
String json([]struct{ match: RegExp, environment: string }) |
false |
[ { "match": "^tags/v?\d+.\d+.\d+$", "environment": "production" }, { "match": "^tags/v?\d+.\d+.\d+-.*\.\d+$", "environment": "stage" }, { "match" :"^heads/main$", "environment": "develop" }, { "match": "^heads/master$", "environment": "develop" } ] |
$ENVIRONMENT_FAIL_ON_NO_REFERENCE |
Fail on missing environment references. | Bool |
false |
true |
$ENVIRONMENT_STRICT |
Fail on no environment selected. | Bool |
false |
true |
$ENVIRONMENT_FILE |
File for writing the environment variables for selected environment. | String |
true |
env.environment |
GIT
Flag / Environment | Description | Type | Required | Default |
---|---|---|---|---|
$CI_COMMIT_REF_NAME $BITBUCKET_BRANCH |
Source control branch. | String |
false |
|
$CI_COMMIT_TAG $BITBUCKET_TAG |
Source control tag. | String |
false |