Is it possible to pass variables from the pipeline to hooks?
The docs mention
This can be useful to do things such as perform a security scan on an image, run database migrations on a deploy, etc
If I wanted to do something that targets the image we’ve just built in the build
step, is there a way for that image name/tag to be passed in? Could gitrefpretty()
be used in a string?
Are there any other functions like gitrefpretty()
available? If so are they documented somewhere?
I’m considering something like this - is there any variable or function I can use to get the image name in the hook command? If not, can gitrefpretty()
be used there? Or could I use it in a string
app "waypoint-up" {
build {
use "docker" {}
registry {
use "docker" {
image = "hashicorp/wpmini"
tag = gitrefpretty()
}
}
# get image name example
hook {
when = "after"
command = ["./integration-test.sh", imagenamepretty()]
}
# gitrefpretty() example
hook {
when = "after"
command = ["./integration-test.sh", "hashicorp/wpmini:${gitrefpretty()}"]
}
}