-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
43 lines (39 loc) · 1.25 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env groovy
void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/Proteus-Eretes/IRIS-beamer"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}
pipeline {
agent any
stages {
stage('Build - JS') {
steps {
echo 'Building...'
setBuildStatus ("Building JS", "PENDING")
sh 'yarn install && yarn build'
}
}
stage('Deploy') {
when {
branch 'master'
}
steps {
echo 'Deploying to master'
sh './node_modules/.bin/shipit live copyConfig'
}
}
}
post {
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
failure {
setBuildStatus("Build failed", "FAILURE");
}
}
}