Details
-
Type:
Bug
-
Status: Open (View Workflow)
-
Priority:
Minor
-
Resolution: Unresolved
-
Component/s: pipeline
-
Labels:None
-
Environment:docker environment
-
Similar Issues:
Description
For our project we are using gitlab-ce and Jenkins to build docker images. I'm using a Pipeline Jenkinsfile to build my docker
I suppose my jenkins job is correctly configured since the build is triggered each time I push a commit or a tag into my gitlab project
In my pipeline, I have a stage I wish to be called only when a tag is pushed (git push --tag)}}
I added the following line:
when
{ buildingTag() }
But every time I push a tag in gitlab, I have the message Stage skipped due to when conditional
Attached the Jenkinsfile I'm using
Context
- Gitlab plugin version: 1.5.11
- Gitlab CE version: 11.2.0
- Jenkins version: 2.163
- Job type: Pipeline (the pipeline plugins are up to date)
Our Jenkins docker container is based on image jenkins/jenkins:2.163-alpine
Attached the console output triggered when after the push of a tag using the command:
git push --tag origin master
Is there something special to do to use the when tag or when buildingTag ? It seems to me I have done everything according to the documentation
OK now I understand why it does not work but do we agree that this limitation is clearly not documented ?
I remembered I tried to do it myself but I had quite some trouble implementing it and it was very frustrating when there is supposed to be a function that do it for you.
Personally I don't really understand why this function, which is probably needed by a lot of people, is restricted to multibranch. Especially since multibranch does not allow project dependency which is a bit one of the main reason Jenkins is used for...
Thanks for your help anyway