-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJenkinsfile
More file actions
56 lines (53 loc) · 1.81 KB
/
Jenkinsfile
File metadata and controls
56 lines (53 loc) · 1.81 KB
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
56
def setupHaxe = { ->
def script = '''
curl http://old.haxe.org/file/haxe-3.1.3-linux64.tar.gz | tar xz
export HAXE_HOME=$PWD/haxe-3.1.3
export HAXE_STD_PATH=$PWD/haxe-3.1.3/std
export PATH=$PATH:$HAXE_HOME
echo HAXE_HOME=$HAXE_HOME
haxe -version
'''
def output = sh script: script, returnStdout: true
def matcher = (output =~ /HAXE_HOME=(.*)/)
haxeHome = matcher[0][1]
return haxeHome
}
def setupTypescript = { ->
def script = '''
npm install typescript@3.2.4
export TS_BIN=$PWD/node_modules/typescript/bin
export PATH=$PATH:$TS_BIN
echo TS_BIN=$TS_BIN
tsc --version
'''
def output = sh script: script, returnStdout: true
def matcher = (output =~ /TS_BIN=(.*)/)
tsBin = matcher[0][1]
return tsBin
}
stage("flow") {
node('boxfish-xenial-executor-small') {
checkout scm
ansiColor('xterm') {
def haxeHome = setupHaxe()
def tsBin = setupTypescript()
try {
withEnv(["PATH+=$haxeHome:$tsBin", "HAXE_STD_PATH=$haxeHome/std"]) {
if (env.BRANCH_NAME == "master") {
withCredentials([usernamePassword(credentialsId: "artifactory-upload", usernameVariable: "USER", passwordVariable: "PASS")]) {
sh './gradlew version clean check install publish -Prelease -PnexusUser=$USER -PnexusPassword=$PASS --stacktrace'
}
} else {
sh './gradlew assemble check'
}
}
} finally {
archiveArtifacts artifacts: 'spaghetti-haxe-support/build/reports/**', allowEmptyArchive: true
archiveArtifacts artifacts: 'spaghetti-js-support/build/reports/**', allowEmptyArchive: true
archiveArtifacts artifacts: 'spaghetti-core/build/reports/**', allowEmptyArchive: true
archiveArtifacts artifacts: 'spaghetti-typescript-support/build/reports/**', allowEmptyArchive: true
archiveArtifacts artifacts: 'gradle-spaghetti-typescript-plugin/build/reports/**', allowEmptyArchive: true
}
}
}
}