-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathJenkinsfile
39 lines (35 loc) · 1.05 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
pipeline {
agent any
environment {
DOCKERHUB_CREDENTIALS = credentials('eb9c1cbf-8638-4a36-b866-dd6beb6471b0')
BACKEND_IMAGE = 'sidharthsingh7/temporary'
DOCKER_TAG = 'latest'
}
stages {
stage('Build') {
steps {
script {
// Build the backend Docker image
sh 'docker build -t $BACKEND_IMAGE:$DOCKER_TAG .'
}
}
}
stage('Push') {
steps {
script {
docker.withRegistry('https://index.docker.io/v1/', 'eb9c1cbf-8638-4a36-b866-dd6beb6471b0') {
def backendImage = docker.image("$BACKEND_IMAGE:$DOCKER_TAG")
backendImage.push()
}
}
}
}
stage('Deploy') {
steps {
script {
sh 'curl -X POST "http://ec2-13-126-149-80.ap-south-1.compute.amazonaws.com:3002/webhook"'
}
}
}
}
}