fix: Hash in Build #4
continuous-integration/drone/push Build is passing Details

main
Flycro 2024-03-24 00:17:56 +01:00
parent 4e65112476
commit dbdc7c1540
3 changed files with 9 additions and 5 deletions

View File

@ -27,5 +27,6 @@ steps:
- pnpm run build
- find /var/www/html/bookstack.octolabs.net -type f -exec chmod 664 {} \\;
- find /var/www/html/bookstack.octolabs.net -type d -exec chmod 775 {} \\;
- env HOME=/home/flycro pm2 stop ecosystem.config.cjs
- env HOME=/home/flycro pm2 start ecosystem.config.cjs
- export GIT_HASH=$(git rev-parse --short HEAD)
- env HOME=/home/flycro GIT_HASH=$GIT_HASH pm2 stop ecosystem.config.cjs
- env HOME=/home/flycro GIT_HASH=$GIT_HASH pm2 start ecosystem.config.cjs

View File

@ -5,7 +5,10 @@ module.exports = {
port: '3377',
exec_mode: 'cluster',
instances: 'max',
script: './.output/server/index.mjs'
script: './.output/server/index.mjs',
env_production: {
"GIT_HASH": process.env.GIT_HASH,
}
}
]
}

View File

@ -5,9 +5,9 @@
"type": "module",
"scripts": {
"serve": "cross-env PORT=3000 HOST=127.0.0.1 node .output/server/index.mjs",
"build": "GIT_HASH=`git rev-parse --short HEAD` nuxi build",
"build": "GIT_HASH=$(git rev-parse --short HEAD) nuxi build",
"cleanup": "nuxi cleanup",
"dev": "GIT_HASH=`git rev-parse --short HEAD` nuxt dev --port=3000 --host=127.0.0.1",
"dev": "GIT_HASH=$(git rev-parse --short HEAD) nuxt dev --port=3000 --host=127.0.0.1",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",