Jenkinsfile

pipeline {
agent any

stages {
stage(‘checkoutSCM ’) {

steps {
checkout([$class: ‘GitSCM’, branches: [[name: ‘*/feat/feature3’]], doGenerateSubmoduleConfigurations: false, userRemoteConfigs: [[url: ‘https://github.com/srini0508/Jenkins-shared-library_demo.git']]])
echo ‘Hello, Maven’
echo ‘${PWD}’
script {
sh ‘sh +x sm1.sh’
def LS = “${sh(script:’cat version_info’, returnStdout: true).trim()}”
println(“newVersion = ${LS}”)
new_version = “${LS}”

}
}
}
stage(‘Print Env’) {

steps {

build job: ‘Git Tag Publisher’, parameters: [[$class: ‘StringParameterValue’, name: ‘VER’, value: new_version]]


echo “${new_version}”



sh ‘java -version’

}
}
stage(‘upload artifact’) {

steps {
echo “new version is:”
echo “${new_version}”
nexusArtifactUploader artifacts: [[artifactId: ‘newartifact’, classifier: ‘’, file: ‘/var/lib/jenkins/config.xml’, type: ‘.txt’]], credentialsId: ‘20ce1308–3d3c-42c5–9a73–03a85f69a966’, groupId: ‘newgroup’, nexusUrl: ‘3.239.58.38:8081/’, nexusVersion: ‘nexus3’, protocol: ‘http’, repository: ‘SemanticTesting’, version: new_version


sh ‘java -version’

}
}
}
}

Srnvspalle

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store