-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
46 lines (42 loc) · 1.22 KB
/
Jenkinsfile
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
pipeline {
agent any
environment {
PATH = "$PATH:/usr/local/bin/" // skaffold, argocd path
SOURCECODE_JENKINS_CREDENTIAL_ID = 'evelyn-git'
SOURCE_CODE_URL = 'https://github.com/evelyn0410/starter.git'
RELEASE_BRANCH = 'main'
}
stages {
stage('init') {
steps {
echo 'init'
echo "Current workspace : ${workspace}"
}
}
stage('checkout') {
steps {
echo 'clone'
git url: "$SOURCE_CODE_URL",
branch: "$RELEASE_BRANCH",
credentialsId: "$SOURCECODE_JENKINS_CREDENTIAL_ID"
sh "ls -al"
}
}
stage('SonarQube Analysis') {
steps{
script {
def scannerHome = tool 'SonarScanner';
withSonarQubeEnv(credentialsId:"SONAR_TOKEN", installationName:'sonarqube') {
sh "./gradlew bootJar"
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
}
stage('workspace clear'){
steps {
cleanWs()
}
}
}
}