forked from simonLegah/UnityProject
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Jenkinsfile
61 lines (48 loc) · 1.53 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
node
{
def mavenHome = tool name: "maven3.6.3"
stage("1. git clone")
{
git credentialsId: 'gitCredentials', url: 'https://github.com/WinifredZenabuin/UnityProject.git'
}
stage("2. Maven Build")
{
sh "${mavenHome}/bin/mvn clean package"
}
stage('3. SonarQube Code Quality report')
{
//sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4. Deploy Artifacts to Nexus')
{
// sh "${mavenHome}/bin/mvn deploy"
}
stage('5. Build Docker Image')
{
sh "docker build -t legah2045/springboot-app ."
}
stage('6. Push Docker Image to Docker Hub')
{
withCredentials([string(credentialsId: 'DockerHubCredentials', variable: 'DockerHubCredentials')]) {
sh " docker login -u legah2045 -p ${DockerHubCredentials} "
}
sh " docker push legah2045/springboot-app "
}
stage('7. Deploy to EKS Kubernetes Cluster')
{
kubernetesDeploy(
configs: 'springboot-app-deployment.yml' ,
kubeconfigId: 'KubernetesClusterConfig' ,
enableConfigSubstitution: true
)
// sh 'kubectl apply -f springboot-app-deployment.yml'
}
stage('8 EmailNotification')
{
mail bcc: '[email protected]', body: '''Build is over
Thanks,
Mithun Technologies,
9980923226.''', cc: '[email protected]', from: '', replyTo: '', subject: 'Build is over!!', to: '[email protected]'
}
*/
}