Hello,
I was trying to set docker image name in `bitbucket-pipelines.yml` as a value of environment variable. Unfortunately, both ways I've tried failed:
step:
image: $IMAGE_NAME
and
step:
image:
name: $IMAGE_NAME
If I replace $IMAGE_NAME with actual value - everything works fine.
Could you please tell me if there is a way to perform it?
Thank you,
would be awesome. I just stumpled upon this issue. removed all hardcoded values from my pipeline definition and added them to team-variables so they can be changed easily without having to change bitbucket-pipeline.yml in all repositories. for everything else it works so far, just image cant be substituted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same issue.
It throws this error when using environment variables: There is a problem with the format of your docker image name at [image > name].
But if you goto the online validator it says it's syntactically valid with the environment variable.
My use case is that I'd like to define my AWS account id and region as environment variables so that the pipeline script is more portable between my local test BB account and the "real" repo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem with the validator is that it only checks the YAML syntax. Seeing as an image name should be a string, and either `my-image:latest` or `$MY_IMAGE` is considered a string, the validator checks out. However as you already understand it doesn't interpolate variables on that specific location.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I've just published an article and a video showing how you can use a variable as the image name.
This solution is based on Dynamic Pipelines and requires a Forge app.
The article shows how to replace an "IMAGE_TAG" value (image: node:$IMAGE_TAG) but would work with no changes when the variable contains the full name of the image.
Hope this helps,
Caterina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would love to have this feature supported !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also hope to get this one day. We regularly upgrade gradle version in gradle.properties and in Jenkins we have the first step extracting gradle version from this file and then uses it for the next step so we don't need to touch pipeline file every time we upgrade gradle.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So many use cases for this functionality! Please vote for this Feature Request: https://jira.atlassian.com/browse/BCLOUD-13014
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hoping to get this feature.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same issue with image name, but also with max-time. For the latter, it says that value should be integer and got string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where did you set the variable?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I set it in team variables also tried local project variables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can confirm that this isn't supported. I've tried several ways of defining the variable but all failed. Repository specific or team wide account variables aren't supported in the image name.
I'd love to see support for this!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"I'd love to see support for this!" yes, please :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would also like to see this feature. How else can you use an image that has been built with a tag based on the BITBUCKET_BUILD_NUMBER?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This would be a great feature. Would love to get this support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That would be very handy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+1. Without this feature, this is not possible to declare the google container registry path dynamically for example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it would be very useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
would be very handy
@David Worthington I too build an image at runtime and need to execute it. In my case a cypress test runner image. Since the step image doesnt support variables I use docker run in the script section.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hard to believe so basic features are not supported. I'm stating to use bb cloud for a few weeks and I'm terrrified how unmature it is comparing to GitLab.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It will reduce the need to commit pipeline files when we need the pipeline to use a different image (say node or Python upgrade cases)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.