-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
55 lines (46 loc) · 2.05 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
45
46
47
48
49
50
51
52
53
54
55
def label = "luigi-${UUID.randomUUID().toString()}"
properties([
buildDiscarder(logRotator(numToKeepStr: '30')),
])
podTemplate(label: label) {
node(label) {
try {
timestamps {
timeout(time:20, unit:"MINUTES") {
ansiColor('xterm') {
stage("checkout luigi") {
checkout scm
}
stage("install lerna") {
execute("npm install")
}
stage("bootstrap lerna") {
execute("./node_modules/.bin/lerna bootstrap")
}
stage("build bundles via lerna") {
execute("./node_modules/.bin/lerna run bundle")
}
stage("run cypress") {
execute("cd core && ./examples/luigi-sample-angular/node_modules/.bin/cypress install && ./examples/luigi-sample-angular/node_modules/.bin/cypress run")
}
stage("archive videos") {
archiveArtifacts allowEmptyArchive: true, artifacts: 'core/cypress/videos/*.mp4'
}
}
}
}
} catch (ex) {
echo "Got exception: ${ex}"
currentBuild.result = "FAILURE"
def body = """${currentBuild.currentResult} ${env.JOB_NAME}${env.BUILD_DISPLAY_NAME}: on branch: ${env.BRANCH_NAME}. See details: ${env.BUILD_URL}"""
emailext body: body, recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], subject: "SF: ${currentBuild.currentResult}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'"
}
}
}
def execute(command) {
def repositoryName = 'luigi'
def buildpack = 'node-buildpack:0.0.8'
workDir = pwd()
// sh "docker run --rm -v $workDir:/$repositoryName -w /$repositoryName ${env.DOCKER_REGISTRY}$buildpack /bin/bash -c '$command'"
sh "docker run --rm -v $workDir:/$repositoryName -w /$repositoryName cypress/base /bin/bash -c '$command'"
}