pseudosubs-v1/Jenkinsfile
2024-02-29 10:59:33 -05:00

41 lines
1.0 KiB
Groovy

pipeline {
agent any
environment {
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:/var/lib/jenkins/bin:${env.PATH}"
}
stages {
stage('Install frontend') {
steps {
sh 'pnpm i'
}
}
stage('Build frontend') {
steps {
sh 'pnpm build-only'
}
}
stage('Install backend') {
steps {
dir("srv") {
sh 'pnpm i'
}
}
}
stage('Build backend') {
steps {
dir("srv") {
sh 'pnpm build'
}
}
}
stage('Deploy') {
steps {
sh 'docker build -t pseudosubs-v1:latest .'
sh 'docker stop pseudosubs-v1 || true'
sh 'docker rm pseudosubs-v1 || true'
sh 'docker run -d --name pseudosubs-v1 -p 3485:3485 pseudosubs-v1:latest'
}
}
}
}