inzynieria_frontend/Jenkinsfile

43 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-12-10 20:12:09 +01:00
pipeline {
agent {
docker {
2021-12-29 00:23:09 +01:00
image 'node:16'
2021-12-10 20:12:09 +01:00
}
}
2021-12-10 22:11:21 +01:00
environment {
HOME = '.'
}
2021-12-10 20:12:09 +01:00
stages {
stage('Build') {
steps {
2021-12-29 00:23:09 +01:00
sh 'npm install'
2021-12-28 21:42:46 +01:00
sh 'npm run build'
2021-12-10 20:12:09 +01:00
}
}
2021-12-28 21:42:46 +01:00
stage('Deploy') {
steps {
sshPublisher(
continueOnError: false,
failOnError: true,
publishers: [
sshPublisherDesc(
2021-12-29 00:23:09 +01:00
configName: "frontend-deploy",
2021-12-28 21:42:46 +01:00
transfers: [
2021-12-29 00:23:09 +01:00
sshTransfer(sourceFiles: '**/*', excludes:'**/node_modules/**'),
2021-12-28 21:42:46 +01:00
sshTransfer(execCommand: """cd /var/www/html \
2021-12-29 00:23:09 +01:00
&& npm install \
2021-12-28 21:42:46 +01:00
&& npm run build""")
],
verbose: true
)
]
)
2021-12-29 00:23:09 +01:00
discordSend description: "Jenkins Pipeline Build", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: "https://discord.com/api/webhooks/921884411178418187/3st2Z5P9mxJnI2haY7eB9Pipwt8jn5noi8jm5AOt53B2DoxoxWaKVXXV0Dw5hmY91Da-"
2021-12-28 21:42:46 +01:00
}
}
2021-12-10 20:12:09 +01:00
}
}