All properties and methods from BoxCommon are valid in addition to the properties and methods documented here.
Writes image tags from build-versions to specified file
Parameters:
format
: eitherenv
oryaml
. If not specified, will attempt to detect fromoutFile
extensionoutFile
: file path to writeyamlPath
: list of parent keys to prepend to generated yaml
Adds the deployTarget credentials
jenkins.yaml:
common:
images:
- test/a
- test/b
deploy:
imageOverrides:
- path: test/b
event: commit/develop
eventFallback: commit/master
Jenkinsfile:
@Library('jenkins-shared-library@master')
import com.boxboat.jenkins.pipeline.deploy.*
def deployments = ["", "dev", "stage", "prod"]
properties([
parameters([
choice(name: 'deploymentKey', choices: deployments, description: 'Deployment', defaultValue: '')
])
])
def deploy = new BoxDeploy()
node() {
deploy.wrap {
stage('Deploy'){
deploy.writeImageTags(
outFile: "image-tags.yaml",
yamlPath: ["global"],
)
deploy.withCredentials() {
sh "helm upgrade --install test ."
}
}
}
}