Building/Deploying on new tag

11 views
Skip to first unread message

Gavin Mogan

unread,
Jan 5, 2017, 9:00:23 PM1/5/17
to Jenkins Users
So my flow as it stands now.

1) Do some work
2) Happy with work
3) Tag a release (v1.0.1 for example)
4) Create a docker image
5) Publish to kubernetes.

In jenkins, I've gotten 4 and 5 working very nicely in pipelines, but it'll either work manually, or on every commit. I remember in freestyle builds, there was a way to say "only include certain branches/tags". Is there something like this in pipeline yet?

Looking at https://issues.jenkins-ci.org/browse/JENKINS-34395 it seems like the work around is to do a filter in one grovy script, to notify another script.

So for now I'm doing

stage('checkout') {
            git credentialsId: '--credentials--', url: '---giturl---'
            versionStr = sh(returnStdout: true, script: 'git tag | sort -V').trim().split("\n")[0]
            sh "git checkout ${versionStr}"
}

Am I missing something? is there a better way of doing this?

Gavin
Reply all
Reply to author
Forward
0 new messages