Modify jenkinsfile for building tailwind

This commit is contained in:
Araozu 2023-12-03 08:01:07 -05:00
parent a9869e23ef
commit ed9377156d
2 changed files with 15 additions and 2 deletions

View File

@ -10,11 +10,23 @@ pipeline {
sh "pm2 delete ${env.JOB_NAME} || true" sh "pm2 delete ${env.JOB_NAME} || true"
} }
} }
stage('Build') { stage('Build java') {
steps { steps {
sh './mvnw clean package' sh './mvnw clean package'
} }
} }
stage('Build frontend') {
environment {
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.WORKSPACE}/node_modules/.bin:${env.PATH}"
}
steps {
sh 'cd frontend && npm install && npm run build'
dir("src/main/resources/frontend") {
sh 'pnpm i'
sh 'pnpm build'
}
}
}
stage('Deploy') { stage('Deploy') {
environment { environment {
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}" PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}"

View File

@ -4,7 +4,8 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "tailwindcss -i ./main.css -o ../static/main.css --watch" "dev": "tailwindcss -i ./main.css -o ../static/main.css --watch",
"build": "tailwindcss -i ./main.css -o ../static/main.css --minify"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",