forked from bsarathkumar42/test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
81 lines (70 loc) · 1.96 KB
/
Jenkinsfile
File metadata and controls
81 lines (70 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
pipeline {
agent any
tools {
maven "maven-3.6.3"
/* choice(
name: 'sarath',
choices: ['DEV', 'QA', 'UAT', 'PROD'],
description: 'Passing the parameters')
*/
}
environment {
//NEXUS_VERSION = "nexus3"
//NEXUS_PROTOCOL = "http"
//NEXUS_URL = "13.233.121.236:8081"
//NEXUS_REPOSITORY = "sarath142"
//NEXUS_CREDENTIAL_ID = "nexus_cred"
registry = "bsarathkumar42/myspringapp1"
registryCredential = 'dockerhub'
dockerImage = ''
project = 'myspringapp1'
appName = 'myspringapp1'
serviceName = "${appName}-backend"
imageVersion = 'development'
namespace = 'development'
namespace1 = 'production'
imageTag = "gcr.io/${project}/${appName}:${imageVersion}.${env.BUILD_NUMBER}"
//scannerHome = tool 'SonarQubeScanner'
}
/* stages {
stage('Environment _variable') {
steps {
echo " The environment is ${params.Env}"
}
}
}*/
stages {
stage("clone code") {
steps {
script {
git credentialsId: 'Github_credentials', url: 'https://github.com/bsarathkumar42/test.git'
}
}
}
stage("Build Artifact") {
steps {
script {
sh "mvn clean package -DskipTests=true"
}
}
}
/* stage('Sonarqube') {
steps {
withSonarQubeEnv('sonar') {
sh " mvn sonar:sonar -Dsonar.host.url=http://52.66.250.13:9000 -Dsonar.login=11b8a2aced56d047f183092eb7268c9ae67c73e4 "
timeout(time: 02, unit: 'MINUTES') {
//waitForQualityGate abortPipeline: true
}
}
}
}
stage("publish to nexus") {
steps {
script {
sh "mvn deploy"
}
}
}
*/
}
}