patch: pipeline minio
This commit is contained in:
@@ -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 '{
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user