Some checks reported errors
default/mapgen/master Something is wrong with the build of this commit
48 lines
1.4 KiB
Groovy
48 lines
1.4 KiB
Groovy
#!groovy
|
|
|
|
node('node') {
|
|
currentBuild.result = "SUCCESS";
|
|
try {
|
|
stage('Checkout'){
|
|
checkout scm
|
|
}
|
|
stage('Build'){
|
|
env.NODE_ENV = "production";
|
|
print "Environment will be : ${env.NODE_ENV}";
|
|
sh 'node -v';
|
|
sh 'npm prune';
|
|
sh 'npm install';
|
|
sh 'gulp dist';
|
|
}
|
|
stage('Deploy'){
|
|
echo 'Copy to web server';
|
|
withCredentials([sshUserPrivateKey(credentialsId: '', keyFileVariable: 'rocket', passphraseVariable: '', usernameVariable: '')]) {
|
|
sh 'rsync -rv ./dist rocketman@oreolek.ru:/var/www/oreolek/my_games/mapgen'
|
|
}
|
|
}
|
|
stage('Cleanup'){
|
|
echo 'prune and cleanup';
|
|
sh 'npm prune';
|
|
sh 'rm node_modules -rf';
|
|
|
|
emailext (
|
|
subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
|
|
body: """<p>SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
|
|
<p>Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
|
|
recipientProviders: [developers()]
|
|
);
|
|
}
|
|
}
|
|
catch (err) {
|
|
currentBuild.result = "FAILURE";
|
|
|
|
emailext (
|
|
subject: "FAILURE: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
|
|
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
|
|
<p>Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
|
|
recipientProviders: [developers()]
|
|
)
|
|
throw err
|
|
}
|
|
}
|