-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
32 lines (32 loc) · 924 Bytes
/
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
pipeline {
agent any
tools {
go 'go1.19'
}
environment {
GO114MODULE = 'on'
CGO_ENABLED = 0
GOPATH = "${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"
}
stages {
stage("BUILD") {
steps {
echo 'BUILD EXECUTION STARTED'
sh 'go version'
sh 'go get ./...'
sh 'docker build . -t pranav18vk/go-movies-crud'
}
}
stage("HEROKU DEPLOYMENT"){
steps {
echo 'DEPLOYING SERVER'
sh 'git config --global user.email "[email protected]"'
sh 'git config --global user.name "pranav"'
sh 'heroku auth:whoami'
sh 'heroku git:remote -a pranav-go-restaurant'
sh 'git checkout master'
sh 'git push heroku master'
}
}
}
}