Compare commits

..

31 Commits

Author SHA1 Message Date
Woodpecker CI
64b3ceff3f chore: release v0.0.7 [skip ci] 2026-05-02 14:20:13 +00:00
spassignat
692c001e9b patch: variable echo
All checks were successful
ci/woodpecker/push/build-pipeline Pipeline was successful
2026-05-02 16:19:11 +02:00
spassignat
f6019b9b5d Merge remote-tracking branch 'origin/main' 2026-05-02 16:18:57 +02:00
spassignat
e4e8eadd6d patch: variable echo 2026-05-02 16:18:48 +02:00
Woodpecker CI
a89ba6a734 chore: release v0.0.6 [skip ci] 2026-05-02 14:16:52 +00:00
spassignat
e00c052ae7 patch: variable
All checks were successful
ci/woodpecker/push/build-pipeline Pipeline was successful
2026-05-02 16:15:54 +02:00
Woodpecker CI
e1d0ab7eef chore: release v0.0.5 [skip ci] 2026-05-02 14:08:20 +00:00
spassignat
769550c990 patch: test 45
All checks were successful
ci/woodpecker/push/build-pipeline Pipeline was successful
2026-05-02 16:07:18 +02:00
spassignat
42f7166a11 Merge remote-tracking branch 'origin/main' 2026-05-02 16:07:07 +02:00
spassignat
9ed7fd6fb2 patch: test 45 2026-05-02 16:07:00 +02:00
Woodpecker CI
040c01d8ce chore: release v0.0.4 [skip ci] 2026-05-02 13:52:10 +00:00
spassignat
8b85904333 patch: test 44
All checks were successful
ci/woodpecker/push/build-pipeline Pipeline was successful
2026-05-02 15:51:09 +02:00
Woodpecker CI
c89e394371 chore: release v0.0.3 [skip ci] 2026-05-02 12:26:37 +00:00
spassignat
0b77ae651d patch: test 43
All checks were successful
ci/woodpecker/push/build-pipeline Pipeline was successful
2026-05-02 14:25:38 +02:00
spassignat
8219974b54 patch: test 42
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 14:22:49 +02:00
spassignat
ca2067a124 patch: test 36
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 14:18:47 +02:00
spassignat
505e4235af patch: test 36
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 14:15:14 +02:00
spassignat
5334fc423d patch: test 35
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 14:12:47 +02:00
spassignat
ceb67387f7 patch: test 34
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 14:09:19 +02:00
spassignat
734d26907d patch: test 33
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 13:57:13 +02:00
spassignat
ea3b0c9d9b patch: test 32
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 13:35:28 +02:00
spassignat
844f373084 patch: test 31
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 13:33:31 +02:00
spassignat
f99a7bedd8 patch: test 30
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 13:06:52 +02:00
spassignat
27dbfa5c48 patch: test 29
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 12:41:54 +02:00
spassignat
bac60bd5a4 patch: test 28
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 12:39:55 +02:00
spassignat
73d814d104 patch: test 27
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 12:38:22 +02:00
spassignat
7ab3d05e64 patch: test 27
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 12:36:22 +02:00
spassignat
0d4c6c256c patch: test 26 2026-05-02 12:34:58 +02:00
spassignat
6b3edd7429 patch: test 25
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 12:29:18 +02:00
spassignat
738255a440 patch: test 24
Some checks failed
ci/woodpecker/push/build-pipeline Pipeline failed
2026-05-02 12:27:17 +02:00
spassignat
5bb1111691 Revert "patch: test 22"
This reverts commit fc215a59a7.
2026-05-02 12:26:14 +02:00
13 changed files with 135 additions and 234 deletions

5
.idea/misc.xml generated
View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="openjdk-22" project-jdk-type="JavaSDK"> <component name="Black">
<option name="sdkName" value="Python 3.11" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="Python 3.11" project-jdk-type="Python SDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@@ -1,6 +1,6 @@
when: when:
- event: push - event: push
branch: [ main ] # ← Les tags ne sont sur aucune "branch" branch: [ main ]
- event: pull_request - event: pull_request
- event: manual - event: manual
@@ -8,28 +8,29 @@ 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
- &wdir /tmp/wdir - &repository domaine-passignat
steps: steps:
# Étape 1: Nettoyage du projet, à ajuster # Étape 1: Nettoyage du projet
- name: clean_project - name: clean_project
image: *git_image image: *git_image
commands: | commands: |
rm -rf dist
mkdir *wdir
ls *wdir
rm -f *wdir/version.env
volumes:
- wdir:wdir
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
- name: prepare - name: prepare
image: *git_image image: *git_image
commands: | commands: |
# Récupérer le message du commit
COMMIT_MSG=$(git log -1 --pretty=%B) COMMIT_MSG=$(git log -1 --pretty=%B)
echo "📝 Message: $COMMIT_MSG" echo "📝 Message: $COMMIT_MSG"
# Déterminer le type de version
if echo "$COMMIT_MSG" | grep -qE "^(major)(\(.*\))?!:"; then if echo "$COMMIT_MSG" | grep -qE "^(major)(\(.*\))?!:"; then
echo "version_type=major" >> $CI_WORKSPACE/version.env echo "version_type=major" >> $CI_WORKSPACE/version.env
echo "🔴 MAJOR - Breaking change" echo "🔴 MAJOR - Breaking change"
@@ -41,18 +42,18 @@ steps:
echo "🟢 PATCH - Correction" echo "🟢 PATCH - Correction"
else else
echo "version_type=none" >> $CI_WORKSPACE/version.env echo "version_type=none" >> $CI_WORKSPACE/version.env
echo "⚠️ Aucun changement de version" echo "⚠️ Aucun changement de version"
fi fi
echo "build_dir=$CI_WORKSPACE/build" >> $CI_WORKSPACE/version.env
depends_on: [ clean_project ] depends_on: [ clean_project ]
# Étape 4: Mettre à jour la version (seulement si nécessaire) # Étape 3: Mettre à jour la version
- name: update_version - name: update_version
image: *node_image image: *node_image
commands: | commands: |
ls -alsR database
mkdir -p database/src/sql
npm ci --cache .npm --prefer-offline
source $CI_WORKSPACE/version.env source $CI_WORKSPACE/version.env
npm ci --cache .npm --prefer-offline
if [ "$version_type" != "none" ]; then if [ "$version_type" != "none" ]; then
CURRENT_VERSION=$(node -p "require('./package.json').version") CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "📦 Version actuelle: $CURRENT_VERSION" echo "📦 Version actuelle: $CURRENT_VERSION"
@@ -61,43 +62,50 @@ steps:
echo "🆕 Nouvelle version: $NEW_VERSION" echo "🆕 Nouvelle version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $CI_WORKSPACE/version.env echo "NEW_VERSION=$NEW_VERSION" >> $CI_WORKSPACE/version.env
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $CI_WORKSPACE/version.env echo "CURRENT_VERSION=$CURRENT_VERSION" >> $CI_WORKSPACE/version.env
echo "artifact=${CI_REPO_NAME}-$NEW_VERSION.tar" >> $CI_WORKSPACE/version.env echo "ARTIFACT=$CI_REPO_NAME-$NEW_VERSION" >> $CI_WORKSPACE/version.env
else else
echo "artifact=no-artifact" >> $CI_WORKSPACE/version.env echo "ARTIFACT=no-artifact" >> $CI_WORKSPACE/version.env
echo "⏭️ Pas de mise à jour de version" echo "⏭️ Pas de mise à jour de version"
fi fi
ls -als
depends_on: [ prepare ] depends_on: [ prepare ]
# Étape 1: Installation des dépendances # Étape 4: Build de l'application
- name: build - name: build
image: *node_image image: *node_image
commands: commands: |
- npm ci --cache .npm --prefer-offline npm ci --cache .npm --prefer-offline
- npm run build npm run build
depends_on: [ update_version ] depends_on: [ update_version ]
# Étape 5: Package des artefacts
# Étape 6: Package des artefacts
- name: package - name: package
image: *curl_image image: *node_image
commands: | commands: |
more $CI_WORKSPACE/version.env
source $CI_WORKSPACE/version.env source $CI_WORKSPACE/version.env
ls -alsR ${CI_WORKSPACE}/artifacts/ ARTIFACT_PATH=$CI_WORKSPACE/artifacts/$NEW_VERSION
ARTIFACT_FILE=$CI_WORKSPACE/artifacts/$ARTIFACT.tar.gz
echo "ARTIFACT_PATH=$ARTIFACT_PATH" >> $CI_WORKSPACE/version.env
echo "ARTIFACT_FILE=$ARTIFACT_FILE" >> $CI_WORKSPACE/version.env
if [ "$version_type" != "none" ]; then if [ "$version_type" != "none" ]; then
WDIR=${CI_WORKSPACE}/artifacts/$NEW_VERSION mkdir -p $ARTIFACT_PATH
echo "create work directory: $WDIR"
mkdir -p $WDIR # Créer les archives individuelles
ls -alsR tar -czf $ARTIFACT_PATH/front.tar.gz -C frontend/dist . 2>/dev/null || echo "⚠️ frontend/dist vide"
tar -czf $WDIR/db.tar.gz -C database . tar -czf $ARTIFACT_PATH/back.tar.gz -C backend/dist . 2>/dev/null || echo "⚠️ backend/dist vide"
echo "create final artifact: ${CI_WORKSPACE}/artifacts/$artifact" tar -czf $ARTIFACT_PATH/db.tar.gz -C database src *.json 2>/dev/null || echo "⚠️ database vide"
tar -cf ${CI_WORKSPACE}/artifacts/$artifact -C $WDIR .
ls -als ${CI_WORKSPACE}/artifacts/$artifact # Créer l'artefact final
cd $ARTIFACT_PATH
tar -cf $ARTIFACT_FILE .
echo "✅ Artefact créé: $ARTIFACT_FILE"
ls -la $ARTIFACT_PATH
fi fi
ls -alsR ${CI_WORKSPACE}/artifacts/ ls -als
depends_on: [ build ] depends_on: [ build ]
# Étape 6: Publication dans Nexus
- name: publish - name: publish
image: *curl_image image: *curl_image
environment: environment:
@@ -107,65 +115,91 @@ steps:
from_secret: nexus_password from_secret: nexus_password
commands: | commands: |
source $CI_WORKSPACE/version.env source $CI_WORKSPACE/version.env
echo "📦 Publication de la version $NEW_VERSION : $artifact" echo $CI_REPO_OWNER
ls -alsR ${CI_WORKSPACE}/artifacts echo $CI_REPO_NAME
curl -v \ if [ "$version_type" != "none" ]; then
-u ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \ echo "📦 Publication de la version $NEW_VERSION : $ARTIFACT"
-F "raw.directory=apps" \ if [ ! -f "$ARTIFACT_FILE" ]; then
-F "raw.asset1=@${CI_WORKSPACE}/artifacts/$artifact" \ echo "❌ Fichier introuvable: $ARTIFACT_FILE"
-F "raw.asset1.filename=$artifact" \ ls -la $ARTIFACT_FILE
http://nexus/service/rest/v1/components?repository=domaine-passignat exit 1
fi
curl -v \
-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
echo "✅ Artefact publié"
else
echo "⏭️ Pas de publication (version_type=none)"
fi
ls -als
depends_on: [ package ] depends_on: [ package ]
# Étape 5: Commit et tag
# Étape 7: Commit et tag (après publication)
- name: commit_tag - name: commit_tag
image: *git_image image: *git_image
environment: environment:
GITEA_TOKEN: GITEA_TOKEN:
from_secret: gitea_token from_secret: gitea_token
commands: | commands: |
# Charger les variables
more $CI_WORKSPACE/version.env
source $CI_WORKSPACE/version.env source $CI_WORKSPACE/version.env
echo "version type: $version_type"
if [ "$version_type" != "none" ]; then if [ "$version_type" != "none" ]; then
echo "http://oauth2:$GITEA_TOKEN@gitea.cicd.exygen.fr/${CI_REPO_OWNER}/${CI_REPO_NAME}.git" git remote set-url origin http://oauth2:$GITEA_TOKEN@gitea.cicd.exygen.fr/$CI_REPO_OWNER/$CI_REPO_NAME.git
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" git config user.email "woodpecker@exygen.fr"
git config user.name "Woodpecker CI" git config user.name "Woodpecker CI"
# Ajouter le remote avec token git add package.json ./database/src/sql/*.sql 2>/dev/null || true
# Ajouter le package.json modifié # Commiter uniquement s'il y a des changements
git add ./database/src/sql/*.sql if ! git diff --cached --quiet; then
git commit -m "chore: release v$NEW_VERSION [skip ci]"
git push origin main
echo "✅ Commit créé"
else
echo " Aucun changement à commiter"
fi
# Vérifier s'il y a des changements # Créer et pousser le tag
# if ! git diff --cached --quiet; then
# Commiter la nouvelle version
git commit -m "Pipeline: update current version v$NEW_VERSION [skip ci]"
git push origin main
echo "✅ Commit new version"
# Créer le tag
git tag -a "v$NEW_VERSION" -m "Release version v$NEW_VERSION" git tag -a "v$NEW_VERSION" -m "Release version v$NEW_VERSION"
git push origin "v$NEW_VERSION" git push origin "v$NEW_VERSION"
echo "🏷️ Tag v$NEW_VERSION created and pushed" echo "🏷️ Tag v$NEW_VERSION créé et pous"
else else
echo "⚠️ Aucun changement à commiter" echo "⚠️ Aucun changement à commiter"
fi fi
ls -als
depends_on: [ publish ] depends_on: [ publish ]
# Étape 8: Déclencher le déploiement
- name: trigger-deployment - name: trigger-deployment
image: woodpeckerci/plugin-trigger:latest image: curlimages/curl:latest
settings: environment:
token: WOODPECKER_TOKEN:
from_secret: woodpecker_token from_secret: woodpecker_token
server: https://woodpecker.cicd.exygen.fr # ← Ajoute l'URL du serveur commands: |
repo: ${CI_REPO_OWNER}/${CI_REPO_NAME} source $CI_WORKSPACE/version.env
branch: main
event: deployment if [ "$version_type" != "none" ]; then
deploy_id: ${CI_PIPELINE_NUMBER} # ← Peut être optionnel echo "🚀 Déclenchement du déploiement pour la version $NEW_VERSION"
deploy_to: production # ← Renommé en "environment" parfois echo "http://woodpecker.cicd.exygen.fr/api/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines"
wait: true # ← Attend la fin du déploiement curl -X POST \
depends_on: [ publish ] "http://woodpecker.cicd.exygen.fr/api/repos/$CI_REPO_OWNER/$CI_REPO_NAME/pipelines" \
-H "Authorization: Bearer $WOODPECKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"branch": "main",
"event": "deployment",
"deploy_to": "production",
"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 ]

View File

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

View File

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

@@ -5,13 +5,12 @@
"moduleResolution": "node", "moduleResolution": "node",
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["front/*"]
}, },
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"jsx": "preserve" "jsx": "preserve"
}, },
"include": [ "include": [
"frontend/**/*" "scripts/*"
], ],
"exclude": ["node_modules", "dist"] "exclude": ["node_modules", "dist"]
} }

8
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@cicd", "name": "cicd",
"version": "2.7.15", "version": "0.0.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@cicd", "name": "cicd",
"version": "2.7.15", "version": "0.0.2",
"license": "Exygen", "license": "Exygen",
"engines": { "engines": {
"node": "<=25.9.0", "node": "<=25.9.0",

View File

@@ -1,7 +1,7 @@
{ {
"name": "cicd", "name": "cicd",
"private": true, "private": true,
"version": "0.0.1", "version": "0.0.7",
"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",
@@ -15,5 +15,11 @@
}, },
"keywords": [], "keywords": [],
"author": "Stephane Passignat", "author": "Stephane Passignat",
"license": "Exygen" "license": "Exygen",
"main": "versions.js",
"repository": {
"type": "git",
"url": "http://gitea.cicd.exygen.fr/stephane/test-cicd.git"
},
"type": "commonjs"
} }

View File

@@ -1,151 +0,0 @@
console.log(process.cwd());
const fs = require('fs');
const builder = require('./generators/generate-jsdoc');
const plant = require('./generators/generate-plantuml');
const data = require('./generators/generate-namedlist');
const tax = require('./generators/generate-tax');
const classesFront = require('./generators/generate-class');
const classesBack = require('./generators/generate-class-back');
const path = require('path');
let path1 = path.join("dist", "back");
if (!fs.existsSync(path1)) {
fs.mkdirSync(path1, {recursive: true});
}
// Fonction pour copier un fichier
function copyFile(source, destination) {
fs.mkdirSync(path.dirname(destination), {recursive: true});
fs.copyFileSync(source, destination);
}
function copyResources() {
// Chemins source et destination
const resources = [{
source: path.join(__dirname, "config", `front-${env}.json`),
target: path.join(__dirname, "front", `config.json`)
}, {
source: path.join(__dirname, "config", `back-${env}.json`),
target: path.join(__dirname, "back", `config.json`)
}, {
source: path.join(__dirname, "config", `front-${env}.json`),
target: path.join(__dirname, "dist/front", `config.json`)
}, {
source: path.join(__dirname, "config", `back-${env}.json`),
target: path.join(__dirname, "dist/back", `config.json`)
}, {
source: path.join(__dirname, "package.json"),
target: path.join(__dirname, "dist", "package.json")
}, {
source: path.join(__dirname, "package-lock.json"),
target: path.join(__dirname, "dist", "package-lock.json")
}, {
source: path.join(__dirname, "vite.config.js"),
target: path.join(__dirname, "dist", "vite.config.js")
}];
for (const resource of resources) {
copyFile(resource.source, resource.target);
}
for (const resource of resources) {
if (resource.target.endsWith("config.json")) {
setConfigVersion(resource.target);
}
}
fs.mkdirSync(path.dirname("dist/model"), {recursive: true});
fs.mkdirSync(path.dirname("dist/back"), {recursive: true});
fs.mkdirSync(path.dirname("dist/app"), {recursive: true});
fs.mkdirSync(path.dirname("dist/data"), {recursive: true});
fs.cpSync("back", "dist/back", {recursive: true});
fs.cpSync("model", "dist/model", {recursive: true});
fs.cpSync("app", "dist/app", {recursive: true});
fs.cpSync("data", "dist/data", {recursive: true});
}
function updateVersion(major = false, minor = false, patch = true) {
let obj;
try {
obj = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
let currentVersion = obj.version;
let versions = currentVersion.split('.');
let majorVersion = versions[0];
let minorVersion = versions[1];
let patchVersion = versions[2];
if (major) {
let number = Number.parseInt(majorVersion);
number++;
versions[0] = number;
versions[1] = 0;
versions[2] = 0;
} else if (minor) {
let number = Number.parseInt(minorVersion);
number++;
versions[0] = majorVersion;
versions[1] = number;
versions[2] = 0;
} else if (patch) {
let number = Number.parseInt(patchVersion);
number++;
versions[0] = majorVersion;
versions[1] = minorVersion;
versions[2] = number;
}
let newVersion = versions.join('.');
obj.version = newVersion;
fs.writeFileSync("./package.json", JSON.stringify(obj, null, "\t"), 'utf8');
let newVar = {
oldVersion: currentVersion,
newVersion: newVersion
};
return newVar;
} catch (e) {
}
}
function setConfigVersion(resource) {
let src;
try {
src = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
let versions = src.version;
target = JSON.parse(fs.readFileSync(resource, 'utf8'));
target.version = versions;
fs.writeFileSync(resource, JSON.stringify(target), 'utf8')
} catch (e) {
}
}
let env = "local";
let major = false;
let minor = false;
let patch = false;
process.argv.forEach(function (val, index, array) {
if (val === "-local") {
env = "local"
} else if (val === "-prod") {
env = "prod";
} else if (val === "-patch") {
patch = true;
} else if (val === "-major") {
major = true;
} else if (val === "-minor") {
minor = true;
}
});
if (patch||minor||major) {
let updateVersion1 = updateVersion(major,minor,patch);
let src = path.join(__dirname, "back", "models", "current.sql");
let tgt = path.join(__dirname, "back", "models", "sql", `version-${updateVersion1.oldVersion}-${updateVersion1.newVersion}.sql`);
fs.copyFileSync(src, tgt);
let writeStream = fs.createWriteStream(src);
writeStream.close();
}
copyResources();
builder.generateJSDocTypes('./model/DataModel.json', './types.js');
plant.generatePlantUML('./model/DataModel.json', './model.puml');
// data.generateTVA("./tva_agriculture_detaillee.csv","./data/NamedList.json");
// tax.generateTax("./tva_agriculture_detaillee.csv","./data/Tax.json");
classesFront.generateClasses('./model/DataModel.json',"./front/data/");
classesBack.generateClasses('./model/DataModel.json',"./back/data/");

View File

@@ -73,8 +73,13 @@ process.argv.forEach(function (val, index, array) {
if (patch||minor||major) { if (patch||minor||major) {
let updateVersion1 = updateVersion(major,minor,patch); let updateVersion1 = updateVersion(major,minor,patch);
let sql = path.join(__dirname,"..", "database", "src","sql");
let src = path.join(__dirname,"..", "database", "current.sql"); let src = path.join(__dirname,"..", "database", "current.sql");
let tgt = path.join(__dirname,"..", "database", "src", "sql", `version-${updateVersion1.oldVersion}-${updateVersion1.newVersion}.sql`); let tgt = path.join(__dirname,"..", "database", "src", "sql", `version-${updateVersion1.oldVersion}-${updateVersion1.newVersion}.sql`);
fs.mkdirSync(sql,{ recursive: true });
if(!fs.existsSync(src)){
fs.appendFileSync(sql, "", 'utf8');
}
fs.copyFileSync(src, tgt); fs.copyFileSync(src, tgt);
let writeStream = fs.createWriteStream(src); let writeStream = fs.createWriteStream(src);
writeStream.close(); writeStream.close();