Compare commits

..

37 Commits

Author SHA1 Message Date
Woodpecker CI
72d52577e3 chore: release v0.0.49 [skip ci] 2026-05-04 17:09:55 +00:00
spassignat
3919254309 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 19:08:55 +02:00
spassignat
b4f2bb4e33 patch: pipeline minio 2026-05-04 19:03:21 +02:00
spassignat
75a3c7febb patch: pipeline minio 2026-05-04 18:54:00 +02:00
Woodpecker CI
735bdfe856 chore: release v0.0.48 [skip ci] 2026-05-04 16:44:58 +00:00
spassignat
f1b0885a30 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 18:43:59 +02:00
Woodpecker CI
7ef43a29cb chore: release v0.0.47 [skip ci] 2026-05-04 16:36:26 +00:00
spassignat
3f6dddcd0a patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 18:35:26 +02:00
spassignat
a2512b1cca Merge remote-tracking branch 'origin/main'
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 18:32:53 +02:00
spassignat
bcee6b5514 patch: pipeline minio 2026-05-04 18:30:52 +02:00
Woodpecker CI
11f0109bc5 chore: release v0.0.46 [skip ci] 2026-05-04 16:27:37 +00:00
spassignat
e25080a87c patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 18:26:39 +02:00
Woodpecker CI
f71058a31a chore: release v0.0.45 [skip ci] 2026-05-04 16:04:26 +00:00
spassignat
bd98d8eb6e patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 18:03:28 +02:00
Woodpecker CI
e684cadb9f chore: release v0.0.44 [skip ci] 2026-05-04 15:58:59 +00:00
spassignat
0c091538e8 patch: pipeline minio
All checks were successful
ci/woodpecker/push/build-pipeline Pipeline was successful
2026-05-04 17:58:00 +02:00
spassignat
ccda246266 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:54:18 +02:00
spassignat
6a55acd235 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:46:18 +02:00
spassignat
faecd90037 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:44:10 +02:00
spassignat
680ac2fd2b patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:35:57 +02:00
spassignat
3d7f20d2bf patch: pipeline minio 2026-05-04 17:31:08 +02:00
spassignat
7df04c4084 patch: pipeline minio 2026-05-04 17:30:16 +02:00
spassignat
ed5ffdbdc0 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:26:17 +02:00
spassignat
f6e52f7420 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:24:26 +02:00
spassignat
35adae3978 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 17:19:25 +02:00
spassignat
161e2c12cf patch: pipeline minio 2026-05-04 17:10:25 +02:00
Woodpecker CI
d20a29408f chore: release v0.0.43 [skip ci] 2026-05-04 14:59:59 +00:00
spassignat
78e682d10f patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 16:59:01 +02:00
Woodpecker CI
c51709bd26 chore: release v0.0.42 [skip ci] 2026-05-04 14:56:07 +00:00
spassignat
cc96f7f5e2 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 16:55:08 +02:00
Woodpecker CI
fdf11214dd chore: release v0.0.41 [skip ci] 2026-05-04 14:52:34 +00:00
spassignat
e4dbf60a20 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 16:51:37 +02:00
Woodpecker CI
307fb3c325 chore: release v0.0.40 [skip ci] 2026-05-04 14:46:03 +00:00
spassignat
e9162550bb patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline was successful
ci/woodpecker/deployment/deploy-pipeline Pipeline failed
2026-05-04 16:45:05 +02:00
Woodpecker CI
9823520d00 chore: release v0.0.39 [skip ci] 2026-05-04 14:44:04 +00:00
spassignat
4e54bed176 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 16:42:58 +02:00
spassignat
3c52e96359 patch: pipeline minio
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-04 16:42:24 +02:00
14 changed files with 57 additions and 28 deletions

View File

@@ -3,9 +3,11 @@ when:
branch: [ main ] branch: [ main ]
variables: variables:
- &node_image node:18-alpine node_image: &node_image node:18-alpine
- &git_image alpine/git git_image: &git_image alpine/git
- &curl_image curlimages/curl:latest curl_image: &curl_image curlimages/curl:latest
nexus_api: &nexus_api http://nexus.cicd.exygen.fr/service/rest/v1
woodpecker_api: &woodpecker_api http://woodpecker.cicd.exygen.fr/api
steps: steps:
# Étape 1: Nettoyage du projet # Étape 1: Nettoyage du projet
@@ -105,6 +107,7 @@ steps:
NEXUS_PASSWORD: NEXUS_PASSWORD:
from_secret: nexus_password from_secret: nexus_password
NEXUS_REPOSITORY: domaine-passignat NEXUS_REPOSITORY: domaine-passignat
NEXUS_API: *nexus_api
commands: | commands: |
source $CI_WORKSPACE/version.env source $CI_WORKSPACE/version.env
@@ -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)"
@@ -170,14 +172,15 @@ steps:
- echo " Save pipeline info" - echo " Save pipeline info"
- echo NEW_VERSION=$NEW_VERSION > .buildinfo - 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 mb local/ci || true - mc mb local/cicd || true
- mc cp .buildinfo local/ci/$CI_REPO_REMOTE_ID/$CI_PIPELINE_NUMBER - mc cp .buildinfo local/cicd/repository_$CI_REPO_REMOTE_ID/pipeline_$CI_PIPELINE_NUMBER
depends_on: [ commit_tag ] depends_on: [ commit_tag ]
# Étape 8: Déclencher le déploiement # Étape 8: Déclencher le déploiement
- name: trigger-deployment - name: trigger-deployment
image: curlimages/curl:latest image: curlimages/curl:latest
environment: environment:
WOODPECKER_API: *woodpecker_api
WOODPECKER_TOKEN: WOODPECKER_TOKEN:
from_secret: woodpecker_token from_secret: woodpecker_token
commands: | commands: |
@@ -186,9 +189,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 '{

View File

@@ -2,27 +2,42 @@
when: when:
- event: [ deployment,manual ] - event: [ deployment,manual ]
variables:
minio_mc: &minio_mc minio/mc
appleboy_drone_scp: &appleboy_drone_scp appleboy/drone-scp
appleboy_drone_ssh: &appleboy_drone_ssh appleboy/drone-ssh
curlimages_curl: &curlimages_curl curlimages/curl:latest
nexus_url: &nexus_url http://nexus.cicd.exygen.fr/repository/domaine-passignat/apps
steps: steps:
- name: share-data - name: get-share-data
image: minio/mc image: *minio_mc
commands: commands:
- echo " Save pipeline info" - echo " Load 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/ci/$CI_REPO_REMOTE_ID/$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
commands: | environment:
source .buildinfo NEXUS_USERNAME:
echo new version: ${NEW_VERSION} from_secret: nexus_username
curl -o /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar \ NEXUS_PASSWORD:
"https://nexus.cicd.exygen.fr/repository/domaine-passignat/apps/${CI_REPO_NAME}/${NEW_VERSION}/${CI_REPO_NAME}-${VERSION}.tar" from_secret: nexus_password
NEXUS_REPOSITORY: domaine-passignat
NEXUS_URL: *nexus_url
commands:
- ls -als
- source .buildinfo
- curl -o /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar "${NEXUS_URL}/${CI_REPO_NAME}/${NEW_VERSION}/${CI_REPO_NAME}-${NEW_VERSION}.tar"
depends_on: [ get-share-data ]
# Étape 7: Transfert vers le serveur distant (SCP) # Étape 7: Transfert vers le serveur distant (SCP)
- name: transfert - name: transfert
image: appleboy/drone-scp image: *appleboy_drone_scp
settings: settings:
host: host:
from_secret: remote_host from_secret: remote_host
@@ -33,11 +48,11 @@ steps:
port: 22 port: 22
source: /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar source: /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar
target: /tmp/ target: /tmp/
depends_on: [ get-artifact ,share-data] depends_on: [ get-artifact ]
# Étape 8: Déploiement sur le serveur distant # Étape 8: Déploiement sur le serveur distant
- name: deploy - name: deploy
image: appleboy/drone-ssh image: *appleboy_drone_ssh
environment: environment:
SUDO_PASSWORD: SUDO_PASSWORD:
from_secret: remote_password from_secret: remote_password
@@ -52,19 +67,20 @@ steps:
envs: envs:
- SUDO_PASSWORD - SUDO_PASSWORD
script: script:
- source .buildinfo
- echo "$${SUDO_PASSWORD}" | sudo -S systemctl stop gestion - echo "$${SUDO_PASSWORD}" | sudo -S systemctl stop gestion
- mkdir -p /srv/volumes/gestion/{front-binaries,back-binaries,tmpdb} - mkdir -p /srv/volumes/gestion/{front-binaries,back-binaries,tmpdb}
- rm -rf /srv/volumes/gestion/front-binaries/* - rm -rf /srv/volumes/gestion/front-binaries/*
- rm -rf /srv/volumes/gestion/back-binaries/* - rm -rf /srv/volumes/gestion/back-binaries/*
- rm -rf /srv/volumes/gestion/tmpdb/* - rm -rf /srv/volumes/gestion/tmpdb/*
- tar -xvf /tmp/${CI_REPO_NAME}-${VERSION}.tar -C /tmp - tar -xvf /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar -C /tmp
- tar -xvf /tmp/front.tar.gz -C /srv/volumes/gestion/front-binaries - tar -xvf /tmp/front.tar.gz -C /srv/volumes/gestion/front-binaries
- tar -xzvf /tmp/back.tar.gz -C /srv/volumes/gestion/back-binaries - tar -xzvf /tmp/back.tar.gz -C /srv/volumes/gestion/back-binaries
- tar -xzvf /tmp/db.tar.gz -C /srv/volumes/gestion/tmpdb - tar -xzvf /tmp/db.tar.gz -C /srv/volumes/gestion/tmpdb
- rm -f /tmp/front.tar.gz - rm -f /tmp/front.tar.gz
- rm -f /tmp/back.tar.gz - rm -f /tmp/back.tar.gz
- rm -f /tmp/db.tar.gz - rm -f /tmp/db.tar.gz
- rm -f /tmp/${CI_REPO_NAME}-${VERSION}.tar - rm -f /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar
- docker-compose up database - docker-compose up database
- cd /srv/volumes/gestion/tmpdb - cd /srv/volumes/gestion/tmpdb
- npm ci --cache .npm --prefer-offline - npm ci --cache .npm --prefer-offline

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -0,0 +1 @@
-- none

View File

@@ -1,7 +1,7 @@
{ {
"name": "cicd", "name": "cicd",
"private": true, "private": true,
"version": "0.0.38", "version": "0.0.49",
"description": "Node.js Rest Apis with Express, Sequelize & PostgreSQL", "description": "Node.js Rest Apis with Express, Sequelize & PostgreSQL",
"scripts": { "scripts": {
"update:patch": "node scripts/update-version.js -patch", "update:patch": "node scripts/update-version.js -patch",