#!/usr/bin/env groovy
@Library('mycom')
import com.mycom.*
// Declarative pipeline //
properties([[$class: 'JiraProjectProperty'], buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')), disableConcurrentBuilds(), parameters([gitParameter(branch: '', branchFilter: '.*', defaultValue: 'origin/integration', description: 'Git Branch', listSize: '10', name: 'branch', quickFilterEnabled: true, selectedValue: 'DEFAULT', sortMode: 'ASCENDING_SMART', tagFilter: '*', type: 'PT_BRANCH')])])
def STAGE
pipeline {
agent { label 'WindowsSlaveWS2016' }
options {
timestamps ()
ansiColor('xterm')
disableConcurrentBuilds()
}
stages {
stage('Code checkout') {
steps {
echo '<< Checking out source code >>'
checkout([$class: 'GitSCM', branches: [[name: '${branch}']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 10, noTags: false, reference: '', shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'gitcredentials', url: 'http://gitserver:8080/myproject']]])
script {
STAGE=env.STAGE_NAME
}
}
}
stage('Get service version') {
steps {
script {
STAGE=env.STAGE_NAME
getServiceVersion('MY/Path', 'ChangeLog.txt', 'myservice')
}
}
}
}
}
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/649378a4-fc37-4d17-ab7a-5916996a629f%40googlegroups.com.
On 3 Mar 2020, at 16:05, judaondo <jonu...@gmail.com> wrote:
Yes, finally I used "String parameter" but that was, what I was trying to avoid... I wanted to help anyone selecting their branch and not typing it.Thank you for your support :)
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5aad998d-c8d8-455e-9a30-a82e8f7cbbbd%40googlegroups.com.