Try fixing Jenkins.

This commit is contained in:
emil28092005
2026-01-18 01:03:36 +00:00
parent dab959d1a5
commit eb476c0b9d
2 changed files with 4 additions and 22 deletions
Vendored
+3 -22
View File
@@ -15,10 +15,6 @@ pipeline {
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
sh '''
set -eux
rm -rf ./* ./.git || true
'''
checkout scm checkout scm
sh ''' sh '''
set -eux set -eux
@@ -31,14 +27,11 @@ pipeline {
stage('Build') { stage('Build') {
steps { steps {
script { script {
def sha = sh(script: "git rev-parse --short HEAD", returnStdout: true).trim() env.GIT_SHA = sh(script: "git rev-parse --short HEAD", returnStdout: true).trim()
env.IMAGE_TAG = sha env.APP_IMAGE = "${IMAGE_NAME}:${env.GIT_SHA}"
env.APP_IMAGE = "${IMAGE_NAME}:${sha}"
} }
sh ''' sh '''
set -eux set -eux
docker version
docker build -t "$APP_IMAGE" . docker build -t "$APP_IMAGE" .
''' '''
} }
@@ -46,10 +39,7 @@ pipeline {
stage('Test') { stage('Test') {
steps { steps {
sh ''' sh 'set -eux; go test ./...'
set -eux
go test ./...
'''
} }
} }
@@ -57,22 +47,13 @@ pipeline {
steps { steps {
sh ''' sh '''
set -eux set -eux
mkdir -p "$DEPLOY_DIR" mkdir -p "$DEPLOY_DIR"
cat > "$DEPLOY_DIR/.env" <<EOF cat > "$DEPLOY_DIR/.env" <<EOF
APP_IMAGE=$APP_IMAGE APP_IMAGE=$APP_IMAGE
EOF EOF
docker compose -f "$COMPOSE_FILE" --project-directory "$DEPLOY_DIR" up -d --remove-orphans docker compose -f "$COMPOSE_FILE" --project-directory "$DEPLOY_DIR" up -d --remove-orphans
docker compose -f "$COMPOSE_FILE" --project-directory "$DEPLOY_DIR" ps
''' '''
} }
} }
} }
post {
always {
echo "Done"
}
}
} }
+1
View File
@@ -9,6 +9,7 @@ services:
restart: unless-stopped restart: unless-stopped
jenkins-agent-docker: jenkins-agent-docker:
user: "0:0"
image: jenkins/inbound-agent:latest-jdk17 image: jenkins/inbound-agent:latest-jdk17
container_name: jenkins-agent-docker container_name: jenkins-agent-docker
environment: environment: