forked from Yeop-seung/Another
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile_DATA
More file actions
36 lines (36 loc) · 1.08 KB
/
Jenkinsfile_DATA
File metadata and controls
36 lines (36 loc) · 1.08 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
pipeline{
agent any
environment {
DATA_CONTAINER_NAME="pipeline-confluent-kafka-rest"
DATA_NAME = "pipeline-confluent-kafka-rest"
}
stages {
stage('Clean'){
steps{
script {
try{
sh "docker stop ${DATA_CONTAINER_NAME}"
sleep 1
sh "docker rm ${DATA_CONTAINER_NAME}"
}catch(e){
sh 'exit 0'
}
}
}
}
stage('Build') {
steps {
script{
sh "sed -i 's/\${DATA_SERVER}/${DATA_SERVER}/' '${WORKSPACE}/another_data/confluent_config/kafka-rest.properties'"
sh "docker build -t pipeline-confluent-kafka-rest ./another_data/."
}
}
}
stage('Deploy'){
steps {
sh "docker run -d --name=${DATA_CONTAINER_NAME} -p 8082:8082 ${DATA_NAME}"
sh "docker image prune --force"
}
}
}
}