Update Jenkinsfile.groovy

This commit is contained in:
fernando 2024-10-04 20:54:44 +00:00
parent 4dcfc72c58
commit b43611ad90

View File

@ -1,29 +1,11 @@
pipeline { pipeline {
agent any agent {
environment { docker { image 'node:14-alpine' }
PATH = "/var/lib/jenkins/bin:/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}"
} }
stages { stages {
stage('Install deps') { stage('Test') {
steps { steps {
sh 'pnpm i' sh 'node --version'
}
}
stage("Test") {
steps {
sh 'pnpm test'
}
}
stage('Build bundle') {
steps {
sh 'rm .env || true'
sh 'echo "THP_BINARY=/var/lib/jenkins/bin/thp" > .env'
sh 'pnpm build'
}
}
stage('Deploy') {
steps {
sh 'cp -r ./dist/* /var/www/thp-docs/'
} }
} }
} }