From fb78742fceaf7a9dac098e251feead11c8aadc46 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sun, 6 Oct 2024 20:45:54 -0500 Subject: [PATCH] fix: jenkinsfile --- Jenkinsfile | 22 ++++++++++++---------- docker/Dockerfile | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6b17f65..510730f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,22 @@ pipeline { -agent { - docker { - image 'golang:1.23-alpine' - } - } + agent any stages { - stage('Install deps') { + stage('Install') { + agent { + docker { + image 'golang:1.23-alpine' + reuseNode true + } + } steps { sh 'go mod tidy' - } - } - stage('Build binary') { - steps { sh 'go build main.go' } } + stage('Populate env') { + sh 'rm .env || true' + sh 'echo "PORT=8007" > .env' + } stage('Profit') { steps { dir('docker') { diff --git a/docker/Dockerfile b/docker/Dockerfile index 596b169..70baeb5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,6 +2,7 @@ FROM alpine:3 COPY ../main . COPY ../public . +COPY ../.env . CMD ["main"]