fix: jenkinsfile

This commit is contained in:
Araozu 2024-10-06 20:45:54 -05:00
parent e2be83ce24
commit fb78742fce
2 changed files with 13 additions and 10 deletions

16
Jenkinsfile vendored
View File

@ -1,20 +1,22 @@
pipeline { pipeline {
agent { agent any
stages {
stage('Install') {
agent {
docker { docker {
image 'golang:1.23-alpine' image 'golang:1.23-alpine'
reuseNode true
} }
} }
stages {
stage('Install deps') {
steps { steps {
sh 'go mod tidy' sh 'go mod tidy'
}
}
stage('Build binary') {
steps {
sh 'go build main.go' sh 'go build main.go'
} }
} }
stage('Populate env') {
sh 'rm .env || true'
sh 'echo "PORT=8007" > .env'
}
stage('Profit') { stage('Profit') {
steps { steps {
dir('docker') { dir('docker') {

View File

@ -2,6 +2,7 @@ FROM alpine:3
COPY ../main . COPY ../main .
COPY ../public . COPY ../public .
COPY ../.env .
CMD ["main"] CMD ["main"]