2022-10-24 08:02:17 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'node:19-bullseye-slim'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
CI = 'true'
|
|
|
|
NODE_ENV = 'production'
|
2022-10-24 08:11:09 +02:00
|
|
|
HOME = '.'
|
|
|
|
npm_config_cache = 'npm_cache'
|
2022-10-24 08:02:17 +02:00
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2022-10-24 08:37:32 +02:00
|
|
|
//sh 'npm install --loglevel=verbose'
|
|
|
|
sh 'npm install'
|
2022-10-24 08:02:17 +02:00
|
|
|
sh 'npm clean-install --only=production'
|
2022-10-24 08:25:01 +02:00
|
|
|
sh 'npm run build'
|
2022-10-24 08:02:17 +02:00
|
|
|
}
|
2022-10-24 08:54:05 +02:00
|
|
|
}
|
|
|
|
stage('Package') {
|
|
|
|
steps {
|
|
|
|
sh 'tar zcf build.tar.gz build/*'
|
|
|
|
}
|
2022-10-24 08:02:17 +02:00
|
|
|
}
|
2022-10-24 08:46:26 +02:00
|
|
|
stage('SSH-publish-transfer') {
|
2022-10-24 08:38:09 +02:00
|
|
|
steps {
|
|
|
|
sshPublisher(
|
|
|
|
continueOnError: false,
|
|
|
|
failOnError: true,
|
|
|
|
publishers: [
|
|
|
|
sshPublisherDesc(
|
|
|
|
configName: "mprill-gonito-front-dev",
|
|
|
|
transfers: [sshTransfer(
|
2022-10-24 08:54:34 +02:00
|
|
|
sourceFiles: 'build.tar.gz',
|
2022-10-24 08:54:05 +02:00
|
|
|
execCommand: 'tar zxf build.tar.gz -O public_html'
|
2022-10-24 08:38:09 +02:00
|
|
|
)],
|
|
|
|
verbose: true
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
}
|
2022-10-24 08:37:32 +02:00
|
|
|
}
|
2022-10-24 08:46:26 +02:00
|
|
|
stage('SSH-publish-permissions') {
|
|
|
|
steps {
|
|
|
|
sshPublisher(
|
|
|
|
continueOnError: false,
|
|
|
|
failOnError: true,
|
|
|
|
publishers: [
|
|
|
|
sshPublisherDesc(
|
|
|
|
configName: "mprill-gonito-front-dev",
|
|
|
|
transfers: [sshTransfer(execCommand: 'chmod o+rX public_html')],
|
|
|
|
verbose: true
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2022-10-24 08:37:32 +02:00
|
|
|
}
|
2022-10-24 08:02:17 +02:00
|
|
|
}
|
|
|
|
|