2024-02-29 14:14:57 +00:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
environment {
|
|
|
|
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:/var/lib/jenkins/bin:${env.PATH}"
|
|
|
|
}
|
|
|
|
stages {
|
2024-02-29 15:57:18 +00:00
|
|
|
stage('Install frontend') {
|
2024-02-29 14:14:57 +00:00
|
|
|
steps {
|
|
|
|
sh 'pnpm i'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build frontend') {
|
|
|
|
steps {
|
|
|
|
sh 'pnpm build-only'
|
|
|
|
}
|
|
|
|
}
|
2024-02-29 15:57:18 +00:00
|
|
|
stage('Install backend') {
|
|
|
|
steps {
|
|
|
|
dir("srv") {
|
|
|
|
sh 'pnpm i'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-29 15:59:33 +00:00
|
|
|
stage('Build backend') {
|
2024-02-29 15:57:18 +00:00
|
|
|
steps {
|
|
|
|
dir("srv") {
|
|
|
|
sh 'pnpm build'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-29 14:14:57 +00:00
|
|
|
stage('Deploy') {
|
|
|
|
steps {
|
2024-02-29 15:57:18 +00:00
|
|
|
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'
|
2024-02-29 14:14:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|