diff --git a/.woodpecker/build-pipeline.yml b/.woodpecker/build-pipeline.yml index 229cbbb..b383cf9 100644 --- a/.woodpecker/build-pipeline.yml +++ b/.woodpecker/build-pipeline.yml @@ -11,20 +11,15 @@ steps: # Étape 1: Nettoyage du projet - name: clean_project image: *git_image - commands: | - ls -als / - touch /shared/build.txt - echo "1 $CI_WORKSPACE" - rm -rf dist - rm -f $CI_WORKSPACE/build/version.env - echo "✅ Nettoyage terminé" - depends_on: [ ] + commands: + - rm -rf dist + - rm -f $CI_WORKSPACE/build/version.env + - echo "✅ Nettoyage terminé" # Étape 2: Analyser le message du commit - name: prepare image: *git_image commands: | - COMMIT_MSG=$(git log -1 --pretty=%B) echo "📝 Message: $COMMIT_MSG" @@ -141,12 +136,7 @@ steps: from_secret: gitea_token commands: | source $CI_WORKSPACE/version.env - if [ -d "/shared" ]; then - echo "Le répertoire shared existe" - ls -als /shared/ - else - exit -1 - fi + if [ "$version_type" != "none" ]; then git remote set-url origin http://oauth2:$GITEA_TOKEN@gitea.cicd.exygen.fr/$CI_REPO_OWNER/$CI_REPO_NAME.git git config user.email "woodpecker@exygen.fr" @@ -172,7 +162,6 @@ steps: else echo "⚠️ Aucun changement à commiter" fi - ls -alsR /shared/builds/ depends_on: [ publish ] - name: share-data diff --git a/.woodpecker/deploy-pipeline.yml b/.woodpecker/deploy-pipeline.yml index 3ef6e5e..c38247b 100644 --- a/.woodpecker/deploy-pipeline.yml +++ b/.woodpecker/deploy-pipeline.yml @@ -4,13 +4,19 @@ when: - event: [ deployment,manual ] steps: + - name: 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/ci/$CI_REPO_REMOTE_ID/$CI_PIPELINE_PARENT .buildinfo + depends_on: [ commit_tag ] + - name: get-artifact image: curlimages/curl:latest commands: | - env - BUILD=/shared/builds/$CI_REPO_REMOTE_ID/$CI_PIPELINE_PARENT - ls -alsR /shared/builds/ - source $BUILD + 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"