Environment¶
class Environment : YamlExport
Declares which environment this job interacts with.
To declare the environment, see Job.environment.
Types¶
EnvironmentAction¶
EnvironmentTier¶
Functions¶
action¶
fun action(action: Environment.EnvironmentAction)
Specify how this job interacts with the environment. See EnvironmentAction.
Example
External resources
name¶
stopJob¶
Specifies a stopJob that will be executed once the environment should be stopped.
The stop job should have the same configuration but without a declared url.
Example
val stopQa by job {
script {
// …
}
environment {
name("qa")
}
}
val deployQa by job {
script {
// …
}
environment {
name("qa")
url("https://qa.your.app/dashboard")
onStop(stopQa)
}
}
External resources
tier¶
fun tier(tier: Environment.EnvironmentTier)
Declares which tier this job deploys.
Example
External resources
toYaml¶
url¶
Declares the URL on which the deployed environment is available.
Example
val deploy-qa by job {
script {
// …
}
environment {
name("qa")
url("https://qa.your.app/dashboard")
}
}
Example: dynamic URL
The URL can be generated by the job itself by combining this feature with Artifacts.dotenv:
val deploy-qa by job {
script {
shell("QA_URL=$(./generate-url) >>qa.env")
}
artifacts {
dotenv("qa.env")
}
environment {
name("qa")
url($$"$QA_URL")
}
}
External resources