-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
44 lines (40 loc) · 1.15 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
44
node {
stage('Checkout') {
checkout scm
}
stage('Before Install') {
def nodeHome = tool 'node-v7'
env.PATH="${env.PATH}:${nodeHome}/bin"
def dockerHome = tool 'docker'
env.PATH="${env.PATH}:${dockerHome}/bin"
}
stage('Install') {
sh 'node -v'
sh 'npm --version'
sh 'docker --version'
sh 'npm install'
}
stage('Build') {
try {
withCredentials([usernameColonPassword(credentialsId: 'PHOVEA_GITHUB_CREDENTIALS', variable: 'PHOVEA_GITHUB_CREDENTIALS')]) {
docker.withRegistry("https://922145058410.dkr.ecr.eu-central-1.amazonaws.com", "ecr:eu-central-1:PHOVEA_AWS_CREDENTIALS") {
wrap([$class: 'Xvfb']) {
sh 'node build.js --skipTests --skipSaveImage --noDefaultTags --pushExtra=latest --pushTo=922145058410.dkr.ecr.eu-central-1.amazonaws.com/caleydo'
}
}
}
currentBuild.result = "SUCCESS"
} catch (e) {
// if any exception occurs, mark the build as failed
currentBuild.result = 'FAILURE'
throw e
} finally {
// always clean up
sh 'npm prune'
sh 'rm node_modules -rf'
}
}
stage('Post Build') {
archiveArtifacts artifacts: 'build/*'
}
}