forked from avielb/rmqp-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
79 lines (64 loc) · 2.32 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
pipeline {
agent any
triggers {
pollSCM('* * * * *')
}
stages {
stage('Hello') {
steps {
echo 'Start your first jenkins project!'
}
}
stage('Checkout') {
steps {
git 'https://github.com/AhroniCsM/devopscourse.git'
}
}
stage('Build and Push Docker images') {
steps {
script {
def producerImage = 'aharoniscsm/producer:latest'
def consumerImage = 'aharoniscsm/consumer:latest'
// Build Docker images
sh 'docker build -t producer ./producer'
sh 'docker build -t consumer ./consumer'
// Tag Docker images
sh "docker tag producer ${producerImage}"
sh "docker tag consumer ${consumerImage}"
// Push Docker images
sh "docker push ${producerImage}"
sh "docker push ${consumerImage}"
}
}
}
// stage('Manual Deployment Approval') {
// steps {
// script {
// // Prompt for manual approval
// def userInput = input(
// id: 'manual-approval',
// message: 'Do you want to deploy?',
// parameters: [choice(choices: ['Yes', 'No'], description: 'Select Yes to deploy', name: 'DEPLOY')]
// )
// // Check user input
// if (userInput == 'No') {
// error('Deployment aborted by user')
// }
// }
// }
// }
stage('Continuous Deployment') {
steps {
script {
// Define Helm release name and namespace
def releaseName = 'aharon'
def namespace = 'default'
sh "helm package helm-chart"
// Add your helm chart path
def helmChartPath = 'my-umbrella-chart-0.1.0.tgz'
sh "helm upgrade --install ${releaseName} ${helmChartPath} --kube-context minikube"
}
}
}
}
}