Professional Documents
Culture Documents
environment {
NEXUS_VERSION = "nexus3"
NEXUS_PROTOCOL = "http"
NEXUS_URL = "http://10.131.31.204:30000"
NEXUS_REPOSITORY = "maven-snapshots"
NEXUS_CREDENTIAL_ID = "nexus-credentials"
}
stage('SCM Checkout'){
git credentialsId: 'github', url:
'git@gitserver.cboitistcs.com:TCS/jenkins_cicd.git'
}
stage('Upload Artifacts'){
script{
def mavenPom = readMavenPom file: 'pom.xml'
def nexusRepoName = mavenPom.version.endsWith("SNAPSHOT") ? "maven-
snapshots" :"maven-releases"
nexusArtifactUploader artifacts: [
[artifactId: 'pom.artifactId',
classifier: '',
file: "target/spring-boot-mongo-${mavenPom.version}.jar",
type: 'jar'
]
],
credentialsId: 'nexus-credentials',
groupId: 'pom.groupId',
nexusUrl: '10.131.31.204:30000',
nexusVersion: 'nexus3',
protocol: 'http',
repository: "${nexusRepoName}",
version: "${mavenPom.version}"
}
}
/**
stage("Deploy To Kubernetes Cluster"){
kubernetesDeploy(
configs: 'springBootMongo.yml',
kubeConfig: [path:'/var/lib/jenkins/.kube/config'],
kubeconfigId: 'KUBECONFIG',
enableConfigSubstitution: true
)
}
**/