Compare commits
78 Commits
692c001e9b
...
v0.0.28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a7169ec69 | ||
|
|
b8e748103d | ||
|
|
7bd7dc0e62 | ||
|
|
68710f91f4 | ||
|
|
fd19361e35 | ||
|
|
213d061f0b | ||
|
|
9f43203b94 | ||
|
|
021c4ed2d3 | ||
|
|
d06877bd7d | ||
|
|
19625f0c13 | ||
|
|
bcf510b936 | ||
|
|
f6139782b4 | ||
|
|
c4297c7c25 | ||
|
|
f89ccb0f63 | ||
|
|
0ba8dd27f0 | ||
|
|
b08a3913e7 | ||
|
|
ac4d180382 | ||
|
|
c5da967d34 | ||
|
|
e916154e4e | ||
|
|
69656f095d | ||
|
|
1cc3d5b5eb | ||
|
|
228ad14fa9 | ||
|
|
067acd0521 | ||
|
|
91af4b5739 | ||
|
|
e267aeb1ca | ||
|
|
4e5e8f0644 | ||
|
|
a253393f58 | ||
|
|
0b1308e8f0 | ||
|
|
838d7a42eb | ||
|
|
55b60e06da | ||
|
|
7ee90cba7c | ||
|
|
bbb29459f6 | ||
|
|
f564b38987 | ||
|
|
78cab3ffe2 | ||
|
|
f8dcae93c5 | ||
|
|
244f46418b | ||
|
|
c334f5ec09 | ||
|
|
9579676b0c | ||
|
|
10dd888152 | ||
|
|
d13bb14f34 | ||
|
|
350d3881f0 | ||
|
|
69b5c0017f | ||
|
|
08d234c8bc | ||
|
|
38a422e305 | ||
|
|
1e2cdf82e6 | ||
|
|
7c88b67418 | ||
|
|
06f135a005 | ||
|
|
8bf8e5448a | ||
|
|
564b5e9f3c | ||
|
|
ed31bcc0e3 | ||
|
|
bd17026643 | ||
|
|
68b3b81273 | ||
|
|
7eedd9549d | ||
|
|
e91c809d23 | ||
|
|
1de56405c4 | ||
|
|
0718c74966 | ||
|
|
e180afb2e3 | ||
|
|
fb305b72b3 | ||
|
|
a7bcffac98 | ||
|
|
62b401b5a1 | ||
|
|
11b254dff0 | ||
|
|
d5a0aa55d5 | ||
|
|
4b5add7403 | ||
|
|
c862b55393 | ||
|
|
bb5aebdc83 | ||
|
|
d169289cb9 | ||
|
|
ca1b8933a6 | ||
|
|
0f10a62426 | ||
|
|
ebcf40efb0 | ||
|
|
066e5565c5 | ||
|
|
91149183a2 | ||
|
|
42ce3769cd | ||
|
|
33ab64f609 | ||
|
|
e63b6c4e3f | ||
|
|
9f5f919ff9 | ||
|
|
bae02f80e2 | ||
|
|
0aa601d144 | ||
|
|
64b3ceff3f |
@@ -1,26 +1,23 @@
|
||||
when:
|
||||
- event: push
|
||||
branch: [ main ]
|
||||
- event: pull_request
|
||||
- event: manual
|
||||
|
||||
variables:
|
||||
- &node_image node:18-alpine
|
||||
- &git_image alpine/git
|
||||
- &curl_image curlimages/curl:latest
|
||||
- &repository domaine-passignat
|
||||
|
||||
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: [ ]
|
||||
|
||||
# Étape 2: Analyser le message du commit
|
||||
@@ -67,15 +64,14 @@ steps:
|
||||
echo "ARTIFACT=no-artifact" >> $CI_WORKSPACE/version.env
|
||||
echo "⏭️ Pas de mise à jour de version"
|
||||
fi
|
||||
ls -als
|
||||
depends_on: [ prepare ]
|
||||
|
||||
# Étape 4: Build de l'application
|
||||
- name: build
|
||||
image: *node_image
|
||||
commands: |
|
||||
npm ci --cache .npm --prefer-offline
|
||||
npm run build
|
||||
commands:
|
||||
- npm ci --cache .npm --prefer-offline
|
||||
- npm run build
|
||||
depends_on: [ update_version ]
|
||||
|
||||
# Étape 5: Package des artefacts
|
||||
@@ -113,10 +109,9 @@ steps:
|
||||
from_secret: nexus_username
|
||||
NEXUS_PASSWORD:
|
||||
from_secret: nexus_password
|
||||
NEXUS_REPOSITORY: domaine-passignat
|
||||
commands: |
|
||||
source $CI_WORKSPACE/version.env
|
||||
echo $CI_REPO_OWNER
|
||||
echo $CI_REPO_NAME
|
||||
|
||||
if [ "$version_type" != "none" ]; then
|
||||
echo "📦 Publication de la version $NEW_VERSION : $ARTIFACT"
|
||||
@@ -126,17 +121,17 @@ steps:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -v \
|
||||
curl -v --fail \
|
||||
-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=*repository
|
||||
http://nexus.cicd.exygen.fr/service/rest/v1/components?repository=$NEXUS_REPOSITORY
|
||||
echo "✅ Artefact publié"
|
||||
else
|
||||
echo "⏭️ Pas de publication (version_type=none)"
|
||||
fi
|
||||
ls -als
|
||||
|
||||
depends_on: [ package ]
|
||||
|
||||
# Étape 7: Commit et tag (après publication)
|
||||
@@ -153,7 +148,17 @@ steps:
|
||||
git config user.email "woodpecker@exygen.fr"
|
||||
git config user.name "Woodpecker CI"
|
||||
|
||||
git add package.json ./database/src/sql/*.sql 2>/dev/null || true
|
||||
echo "ℹ️ Save pipeline info"
|
||||
env
|
||||
BUILD=.woodpecker/builds/$CI_REPO_REMOTE_ID/$CI_PIPELINE_NUMBER
|
||||
mkdir -p .woodpecker/builds/$CI_REPO_REMOTE_ID/
|
||||
echo NEW_VERSION=$NEW_VERSION > $BUILD
|
||||
echo NEW_VERSION=$NEW_VERSION > $BUILD
|
||||
git add $BUILD 2>/dev/null || true
|
||||
|
||||
echo "ℹ️ add generated files (sql)"
|
||||
git add ./database/src/sql/*.sql 2>/dev/null || true
|
||||
git add package.json 2>/dev/null || true
|
||||
|
||||
# Commiter uniquement s'il y a des changements
|
||||
if ! git diff --cached --quiet; then
|
||||
@@ -182,11 +187,12 @@ steps:
|
||||
from_secret: woodpecker_token
|
||||
commands: |
|
||||
source $CI_WORKSPACE/version.env
|
||||
|
||||
if [ "$version_type" != "none" ]; then
|
||||
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 -X POST \
|
||||
curl -v --fail -X POST \
|
||||
"http://woodpecker.cicd.exygen.fr/api/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" \
|
||||
-H "Authorization: Bearer $WOODPECKER_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
@@ -197,9 +203,35 @@ steps:
|
||||
"deploy_id": "'$CI_PIPELINE_NUMBER'",
|
||||
"ref": "refs/tags/v'$NEW_VERSION'"
|
||||
}'
|
||||
|
||||
echo "✅ Événement deployment déclenché"
|
||||
else
|
||||
echo "⏭️ Pas de déclenchement (version_type=none)"
|
||||
fi
|
||||
depends_on: [ commit_tag ]
|
||||
when:
|
||||
- event: never
|
||||
|
||||
|
||||
- name: trigger-deployment2
|
||||
image: woodpeckerci/plugin-trigger
|
||||
settings:
|
||||
# L'URL de votre serveur Woodpecker
|
||||
server: https://woodpecker.cicd.exygen.fr
|
||||
# Le token d'API (doit être stocké comme secret)
|
||||
branche: main
|
||||
deploy_pipeline: ${CI_PIPELINE_NUMBER}
|
||||
token:
|
||||
from_secret: woodpecker_token
|
||||
# Le dépôt cible, avec la branche optionnelle (format propriétaire/répertoire[@branche])
|
||||
repo: domaine-passignat/gestion
|
||||
# Paramètre CLÉ : active l'événement 'deployment' et spécifie l'environnement cible
|
||||
deploy_to: production
|
||||
# (Optionnel) Transmettre des variables au pipeline déclenché (ex: une version)
|
||||
params:
|
||||
- VERSION=${NEW_VERSION}
|
||||
# (Optionnel) Attendre la fin du pipeline déclenché
|
||||
wait: true
|
||||
# Déclenche cette étape uniquement après une publication réussie
|
||||
depends_on: [ commit_tag ]
|
||||
when:
|
||||
- event: never
|
||||
|
||||
1
.woodpecker/builds/100
Normal file
1
.woodpecker/builds/100
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.24
|
||||
1
.woodpecker/builds/102
Normal file
1
.woodpecker/builds/102
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.25
|
||||
1
.woodpecker/builds/104
Normal file
1
.woodpecker/builds/104
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.26
|
||||
1
.woodpecker/builds/106
Normal file
1
.woodpecker/builds/106
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.27
|
||||
1
.woodpecker/builds/3/108
Normal file
1
.woodpecker/builds/3/108
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.28
|
||||
1
.woodpecker/builds/95
Normal file
1
.woodpecker/builds/95
Normal file
@@ -0,0 +1 @@
|
||||
0.0.21
|
||||
1
.woodpecker/builds/97
Normal file
1
.woodpecker/builds/97
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.22
|
||||
1
.woodpecker/builds/98
Normal file
1
.woodpecker/builds/98
Normal file
@@ -0,0 +1 @@
|
||||
NEW_VERSION=0.0.23
|
||||
@@ -1,15 +1,19 @@
|
||||
# Documentation: https://woodpecker-ci.org/docs/usage/workflow-syntax
|
||||
|
||||
when:
|
||||
- event: deployment
|
||||
- event: [ deployment,manual ]
|
||||
|
||||
steps:
|
||||
- name: get-artifact
|
||||
image: curlimages/curl:latest
|
||||
commands: |
|
||||
VERSION=${CI_COMMIT_TAG#v}
|
||||
curl -o /tmp/${CI_REPO_NAME}-${VERSION}.tar \
|
||||
"https://nexus.cicd.exygen.fr/repository/domaine-passignat/apps/${CI_REPO_NAME}/${VERSION}/${CI_REPO_NAME}-${VERSION}.tar"
|
||||
env
|
||||
BUILD=.woodpecker/builds/$CI_REPO_REMOTE_ID/$CI_PIPELINE_PARENT
|
||||
ls -als .woodpecker/builds/$CI_REPO_REMOTE_ID/
|
||||
source $BUILD
|
||||
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"
|
||||
|
||||
# Étape 7: Transfert vers le serveur distant (SCP)
|
||||
- name: transfert
|
||||
@@ -22,7 +26,7 @@ steps:
|
||||
password:
|
||||
from_secret: remote_password
|
||||
port: 22
|
||||
source: /tmp/${CI_REPO_NAME}-${VERSION}.tar
|
||||
source: /tmp/${CI_REPO_NAME}-${NEW_VERSION}.tar
|
||||
target: /tmp/
|
||||
depends_on: [ get-artifact ]
|
||||
|
||||
|
||||
1
database/src/sql/version-0.0.10-0.0.11.sql
Normal file
1
database/src/sql/version-0.0.10-0.0.11.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.11-0.0.12.sql
Normal file
1
database/src/sql/version-0.0.11-0.0.12.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.12-0.0.13.sql
Normal file
1
database/src/sql/version-0.0.12-0.0.13.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.13-0.0.14.sql
Normal file
1
database/src/sql/version-0.0.13-0.0.14.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.14-0.0.15.sql
Normal file
1
database/src/sql/version-0.0.14-0.0.15.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.15-0.0.16.sql
Normal file
1
database/src/sql/version-0.0.15-0.0.16.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.16-0.0.17.sql
Normal file
1
database/src/sql/version-0.0.16-0.0.17.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.17-0.0.18.sql
Normal file
1
database/src/sql/version-0.0.17-0.0.18.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.18-0.0.19.sql
Normal file
1
database/src/sql/version-0.0.18-0.0.19.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.19-0.0.20.sql
Normal file
1
database/src/sql/version-0.0.19-0.0.20.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.20-0.0.21.sql
Normal file
1
database/src/sql/version-0.0.20-0.0.21.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.21-0.0.22.sql
Normal file
1
database/src/sql/version-0.0.21-0.0.22.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.22-0.0.23.sql
Normal file
1
database/src/sql/version-0.0.22-0.0.23.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.23-0.0.24.sql
Normal file
1
database/src/sql/version-0.0.23-0.0.24.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.24-0.0.25.sql
Normal file
1
database/src/sql/version-0.0.24-0.0.25.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.25-0.0.26.sql
Normal file
1
database/src/sql/version-0.0.25-0.0.26.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.26-0.0.27.sql
Normal file
1
database/src/sql/version-0.0.26-0.0.27.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.27-0.0.28.sql
Normal file
1
database/src/sql/version-0.0.27-0.0.28.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.6-0.0.7.sql
Normal file
1
database/src/sql/version-0.0.6-0.0.7.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.7-0.0.8.sql
Normal file
1
database/src/sql/version-0.0.7-0.0.8.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.8-0.0.9.sql
Normal file
1
database/src/sql/version-0.0.8-0.0.9.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
1
database/src/sql/version-0.0.9-0.0.10.sql
Normal file
1
database/src/sql/version-0.0.9-0.0.10.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- none
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "cicd",
|
||||
"private": true,
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.28",
|
||||
"description": "Node.js Rest Apis with Express, Sequelize & PostgreSQL",
|
||||
"scripts": {
|
||||
"update:patch": "node scripts/update-version.js -patch",
|
||||
|
||||
Reference in New Issue
Block a user