Merge pull request 'adding jenkins pipeline' (#8) from dev into main
Reviewed-on: winter-access/backend_nam#8
This commit is contained in:
commit
642870f192
|
|
@ -0,0 +1,29 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'main', url: 'https://git.winteraccess.id/winter-access/backend_nam.git'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Pulling, Building, and Deploying') {
|
||||
steps {
|
||||
sh 'cd /home/developer/backend_nam'
|
||||
sh 'git pull origin main'
|
||||
sh 'go mod tidy'
|
||||
sh 'go build -o myapp'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stage('Restart Service') {
|
||||
steps {
|
||||
// Add your deployment steps here
|
||||
sh 'sudo systemctl daemon-reload'
|
||||
sh 'sudo systemctl restart backend-nam'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue