Jenkins + pm2 with nuxt conf
This commit is contained in:
parent
02589af438
commit
436db3e1eb
28
Jenkinsfile
vendored
28
Jenkinsfile
vendored
@ -10,11 +10,33 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh 'npm install --production'
|
sh 'npm install --production'
|
||||||
sh 'npm run build'
|
sh 'npm run build'
|
||||||
sh 'npm run start'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Deploy') {
|
||||||
|
steps {
|
||||||
|
sshPublisher(
|
||||||
|
continueOnError: false,
|
||||||
|
failOnError: true,
|
||||||
|
publishers: [
|
||||||
|
sshPublisherDesc(
|
||||||
|
configName: "frontent-deploy",
|
||||||
|
transfers: [
|
||||||
|
sshTransfer(sourceFiles: '**/*', excludes:'**/npm_modules/**'),
|
||||||
|
sshTransfer(execCommand: """cd /var/www/html \
|
||||||
|
&& npm install --production \
|
||||||
|
&& npm run build""")
|
||||||
|
],
|
||||||
|
verbose: true
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
// discordSend description: "Jenkins Pipeline Build", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: "https://discord.com/api/webhooks/921884411178418187/3st2Z5P9mxJnI2haY7eB9Pipwt8jn5noi8jm5AOt53B2DoxoxWaKVXXV0Dw5hmY91Da-"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
11
ecosystem.config.js
Normal file
11
ecosystem.config.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module.exports = {
|
||||||
|
apps: [
|
||||||
|
{
|
||||||
|
name: 'inzynieria_frontend',
|
||||||
|
exec_mode: 'cluster',
|
||||||
|
instances: 'max', // Or a number of instances
|
||||||
|
script: './node_modules/nuxt/bin/nuxt.js',
|
||||||
|
args: 'start'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user