From 161e2c12cfdcb3e5689019357791dcbc7c889c32 Mon Sep 17 00:00:00 2001 From: spassignat Date: Mon, 4 May 2026 17:10:25 +0200 Subject: [PATCH] patch: pipeline minio --- .woodpecker/build-pipeline.yml | 17 +++++++++-------- .woodpecker/deploy-pipeline.yml | 15 ++++++++++----- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.woodpecker/build-pipeline.yml b/.woodpecker/build-pipeline.yml index b222748..7bcf11c 100644 --- a/.woodpecker/build-pipeline.yml +++ b/.woodpecker/build-pipeline.yml @@ -3,9 +3,12 @@ when: branch: [ main ] variables: - - &node_image node:18-alpine - - &git_image alpine/git - - &curl_image curlimages/curl:latest + - &node_image: node:18-alpine + - &git_image: alpine/git + - &curl_image: curlimages/curl:latest + - NEXUS_API: http://nexus.cicd.exygen.fr/service/rest/v1/ + - WOODPECKER_API: http://woodpecker.cicd.exygen.fr/api + - NEXUS_URL: http://nexus.cicd.exygen.fr/repository/domaine-passignat/apps steps: # Étape 1: Nettoyage du projet @@ -120,8 +123,7 @@ steps: -u "$NEXUS_USERNAME:$NEXUS_PASSWORD" \ -F "raw.directory=apps/$CI_REPO_NAME/$NEW_VERSION" \ -F "raw.asset1=@$ARTIFACT_FILE" \ - -F "raw.asset1.filename=$ARTIFACT" \ - http://nexus.cicd.exygen.fr/service/rest/v1/components?repository=$NEXUS_REPOSITORY + -F "raw.asset1.filename=$ARTIFACT" ${NEXUS_API}/components?repository=$NEXUS_REPOSITORY echo "✅ Artefact publié" else echo "⏭️ Pas de publication (version_type=none)" @@ -186,9 +188,8 @@ steps: echo "🚀 Déclenchement du déploiement pour la version $NEW_VERSION" echo "🚀 $CI_REPO_OWNER" echo "🚀 $CI_REPO_NAME" - echo "http://woodpecker.cicd.exygen.fr/api/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" - curl -v --fail -X POST \ - "http://woodpecker.cicd.exygen.fr/api/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" \ + echo "${WOODPECKER_API}/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" + curl -v --fail -X POST "${WOODPECKER_API}/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" \ -H "Authorization: Bearer $WOODPECKER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ diff --git a/.woodpecker/deploy-pipeline.yml b/.woodpecker/deploy-pipeline.yml index 1bac9ab..62b7560 100644 --- a/.woodpecker/deploy-pipeline.yml +++ b/.woodpecker/deploy-pipeline.yml @@ -2,23 +2,28 @@ when: - event: [ deployment,manual ] +variables: + - NEXUS_URL: https://nexus.cicd.exygen.fr/repository/domaine-passignat/apps + steps: - name: get-share-data image: minio/mc commands: - echo "ℹ️ Save pipeline info" - - echo NEW_VERSION=$NEW_VERSION > .buildinfo - mc alias set local http://minio:9000 minioadmin minioadmin123 - mc get local/cicd/repository_$CI_REPO_REMOTE_ID/pipeline_$CI_PIPELINE_PARENT .buildinfo + - ls -als + - more .buildinfo - name: get-artifact image: curlimages/curl:latest commands: | - source .buildinfo - echo new version: ${NEW_VERSION} - curl -o /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar \ - "https://nexus.cicd.exygen.fr/repository/domaine-passignat/apps/${CI_REPO_NAME}/${NEW_VERSION}/${CI_REPO_NAME}-${VERSION}.tar" + - ls -als + - more .buildinfo + - source .buildinfo + - echo new version: ${NEW_VERSION} + - curl -o /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar "${NEXUS_URL}/${CI_REPO_NAME}/${NEW_VERSION}/${CI_REPO_NAME}-${VERSION}.tar" depends_on: [ get-share-data] # Étape 7: Transfert vers le serveur distant (SCP)