2024-10-07 01:29:28 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
2024-10-07 01:41:11 +00:00
|
|
|
image 'golang:1.23-alpine'
|
2024-10-07 01:29:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Install deps') {
|
|
|
|
steps {
|
|
|
|
sh 'go mod tidy'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build binary') {
|
|
|
|
steps {
|
|
|
|
sh 'go build main.go'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Profit') {
|
|
|
|
steps {
|
2024-10-07 01:41:11 +00:00
|
|
|
dir('docker') {
|
|
|
|
sh 'docker compose stop || true'
|
|
|
|
sh 'docker compose up --build -d'
|
|
|
|
}
|
2024-10-07 01:29:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|