Fix Jenkinsfile.

This commit is contained in:
emil28092005
2026-01-18 05:46:28 +03:00
parent e05d1000f8
commit d7427c55dd
Vendored
+17 -12
View File
@@ -45,23 +45,28 @@ pipeline {
''' '''
} }
} }
stage('Debug env') {
stage('Deploy') {
when {
beforeAgent true
branch 'main'
}
steps { steps {
sh ''' sh '''
set -eux echo "BRANCH_NAME=$BRANCH_NAME"
mkdir -p "$DEPLOY_DIR" echo "GIT_BRANCH=$GIT_BRANCH"
cat > "$DEPLOY_DIR/.env" <<EOF git rev-parse --abbrev-ref HEAD || true
APP_IMAGE=$APP_IMAGE git rev-parse HEAD
EOF
docker compose -f "$COMPOSE_FILE" --project-directory "$DEPLOY_DIR" up -d --remove-orphans
''' '''
} }
} }
stage('Deploy') {
when {
expression { env.GIT_BRANCH == 'origin/main' || env.GIT_BRANCH == 'main' }
}
steps {
sh 'echo "deploying"'
sh 'touch /opt/shagram/TEST_WEBHOOK.txt'
}
}
} }
} }