#!/usr/bin/env groovy
@Library('mycom')
import com.mycom.*
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: script {
STAGE=env.STAGE_NAME
}
}
}
stage('Get service version') {
steps {
script {
STAGE=env.STAGE_NAME
getServiceVersion('MY/Path', 'ChangeLog.txt', 'myservice')
}
}
}
}
}