-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question - Assistance to get build running with TAG_NAME built-in substitutions #15
Comments
I have tried to a an additional step
But that just resulted in an error |
I have tried to run the following from command line, in my repository: > gcloud builds submit --config=cloudbuild.yaml --substitutions=TAG_NAME="0.0.1" And that works fine. So my guess is that, some how the |
Hi @navierula, I can see you did the last commit to master on this here repository. Can you help please? Thanks in advance. |
Hi @kaaquist, I'm new to GCP and I'm working on a similar build:
|
@SebastianGogoasa thanks. That could make sense. I guess I could try that. I created a workaround and that have worked fine for last year or so. |
Hi! I ran into this thread looking for the same issue. It doesn't seem to have any update and using TAG_NAME even when fetching from a branch makes sense. I'm moving to SHORT_SHA too, but it would be great to get this working |
Just did a quick test of this behavior, and it works as I would expect, TAG_NAME and BRANCH_NAME are both useable regardless of trigger type, but in the case of a branch trigger TAG_NAME is empty, and same for BRANCH_NAME when using a tag trigger. Are you expecting different behavior, I'm not sure why you would expect TAG_NAME to have a value when fetching from a branch. |
It'd be awesome if we could substitute the substitute haha. I'm just trying to debug a cloud build trigger file and need to plugin the TAG_NAME value to some arbitrary release a while back. We have triggers setup on tag already and so I can't just assign it to a Tag event type. |
This is an old thread, but @Jlrine2, the behavior I would expect is that TAG_NAME and BRANCH_NAME are always available regardless of the trigger type. For example, I could push a tag to any branch, but I do not want my build to trigger unless I push to the main branch. However, I want to build my container image tag based on the latest TAG_NAME on that commit. Attempting to do this manually in a build step, i.e.
Attempting to do this in it's own step fails as well with the error:
It is very unfortunate that you cannot find the tag name when pushed to a branch. Alternatively, it should be possible to trigger on tag, but only with specific branches. |
I got an issue, that I have not been able to find a solution for.
I have installed and setup cloud build to be able to build code fetched from my private github repositories. It is working and I have created nice flows that builds dockers and push them to
GCR
etc.I have now added a new build where I would like to tag my docker images with the
git tag
. I found that I could use theTAG_NAME
built-in substitution variable to do that. But my problem is that it is never set when running the build. It seems that when fetching/pull the code from github no tags are fetched/pull.config yaml
Here is the tag on my git(hub) repo. (it has been pushed to remote too).
So what am I missing?
This here is the build-in substitutions for latest build, found on the execution detail tab under the failed build.
But the
TAG_NAME
is not set...Hope to hear from you soon. Thanks in advance.
The text was updated successfully, but these errors were encountered: