patch: pipeline minio
This commit is contained in:
@@ -3,9 +3,12 @@ when:
|
|||||||
branch: [ main ]
|
branch: [ main ]
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &node_image node:18-alpine
|
- &node_image: node:18-alpine
|
||||||
- &git_image alpine/git
|
- &git_image: alpine/git
|
||||||
- &curl_image curlimages/curl:latest
|
- &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:
|
steps:
|
||||||
# Étape 1: Nettoyage du projet
|
# Étape 1: Nettoyage du projet
|
||||||
@@ -120,8 +123,7 @@ steps:
|
|||||||
-u "$NEXUS_USERNAME:$NEXUS_PASSWORD" \
|
-u "$NEXUS_USERNAME:$NEXUS_PASSWORD" \
|
||||||
-F "raw.directory=apps/$CI_REPO_NAME/$NEW_VERSION" \
|
-F "raw.directory=apps/$CI_REPO_NAME/$NEW_VERSION" \
|
||||||
-F "raw.asset1=@$ARTIFACT_FILE" \
|
-F "raw.asset1=@$ARTIFACT_FILE" \
|
||||||
-F "raw.asset1.filename=$ARTIFACT" \
|
-F "raw.asset1.filename=$ARTIFACT" ${NEXUS_API}/components?repository=$NEXUS_REPOSITORY
|
||||||
http://nexus.cicd.exygen.fr/service/rest/v1/components?repository=$NEXUS_REPOSITORY
|
|
||||||
echo "✅ Artefact publié"
|
echo "✅ Artefact publié"
|
||||||
else
|
else
|
||||||
echo "⏭️ Pas de publication (version_type=none)"
|
echo "⏭️ Pas de publication (version_type=none)"
|
||||||
@@ -186,9 +188,8 @@ steps:
|
|||||||
echo "🚀 Déclenchement du déploiement pour la version $NEW_VERSION"
|
echo "🚀 Déclenchement du déploiement pour la version $NEW_VERSION"
|
||||||
echo "🚀 $CI_REPO_OWNER"
|
echo "🚀 $CI_REPO_OWNER"
|
||||||
echo "🚀 $CI_REPO_NAME"
|
echo "🚀 $CI_REPO_NAME"
|
||||||
echo "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 \
|
curl -v --fail -X POST "${WOODPECKER_API}/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" \
|
||||||
"http://woodpecker.cicd.exygen.fr/api/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" \
|
|
||||||
-H "Authorization: Bearer $WOODPECKER_TOKEN" \
|
-H "Authorization: Bearer $WOODPECKER_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d '{
|
||||||
|
|||||||
@@ -2,23 +2,28 @@
|
|||||||
|
|
||||||
when:
|
when:
|
||||||
- event: [ deployment,manual ]
|
- event: [ deployment,manual ]
|
||||||
|
variables:
|
||||||
|
- NEXUS_URL: https://nexus.cicd.exygen.fr/repository/domaine-passignat/apps
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: get-share-data
|
- name: get-share-data
|
||||||
image: minio/mc
|
image: minio/mc
|
||||||
commands:
|
commands:
|
||||||
- echo "ℹ️ Save pipeline info"
|
- echo "ℹ️ Save pipeline info"
|
||||||
- echo NEW_VERSION=$NEW_VERSION > .buildinfo
|
|
||||||
- mc alias set local http://minio:9000 minioadmin minioadmin123
|
- mc alias set local http://minio:9000 minioadmin minioadmin123
|
||||||
- mc get local/cicd/repository_$CI_REPO_REMOTE_ID/pipeline_$CI_PIPELINE_PARENT .buildinfo
|
- mc get local/cicd/repository_$CI_REPO_REMOTE_ID/pipeline_$CI_PIPELINE_PARENT .buildinfo
|
||||||
|
- ls -als
|
||||||
|
- more .buildinfo
|
||||||
|
|
||||||
- name: get-artifact
|
- name: get-artifact
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
commands: |
|
commands: |
|
||||||
source .buildinfo
|
- ls -als
|
||||||
echo new version: ${NEW_VERSION}
|
- more .buildinfo
|
||||||
curl -o /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar \
|
- source .buildinfo
|
||||||
"https://nexus.cicd.exygen.fr/repository/domaine-passignat/apps/${CI_REPO_NAME}/${NEW_VERSION}/${CI_REPO_NAME}-${VERSION}.tar"
|
- 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]
|
depends_on: [ get-share-data]
|
||||||
|
|
||||||
# Étape 7: Transfert vers le serveur distant (SCP)
|
# Étape 7: Transfert vers le serveur distant (SCP)
|
||||||
|
|||||||
Reference in New Issue
Block a user