music-to-go/Jenkinsfile

30 lines
441 B
Plaintext
Raw Normal View History

2024-10-07 01:29:28 +00:00
pipeline {
2024-10-07 01:45:54 +00:00
agent any
2024-10-07 01:29:28 +00:00
stages {
2024-10-07 01:45:54 +00:00
stage('Install') {
agent {
docker {
image 'golang:1.23-alpine'
reuseNode true
}
2024-10-07 01:29:28 +00:00
}
steps {
2024-10-07 01:45:54 +00:00
sh 'go mod tidy'
2024-10-07 01:29:28 +00:00
sh 'go build main.go'
}
}
2024-10-07 01:45:54 +00:00
stage('Populate env') {
sh 'rm .env || true'
sh 'echo "PORT=8007" > .env'
}
2024-10-07 01:29:28 +00:00
stage('Profit') {
steps {
dir('docker') {
sh 'docker compose stop || true'
sh 'docker compose up --build -d'
}
2024-10-07 01:29:28 +00:00
}
}
}
}