forked from pentaho/pentaho-kettle
-
Notifications
You must be signed in to change notification settings - Fork 196
/
Jenkinsfile
61 lines (58 loc) · 2.86 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
56
57
58
59
60
61
def GetScmProjectName() {
return scm.getUserRemoteConfigs()[0].getUrl().tokenize('/').last().split("\\.")[0]
}
pipeline {
agent any
environment {
GITHUB_TOKEN = credentials('9e494763-394a-4837-a25f-c1e9e61a7289')
repo = GetScmProjectName()
version = 'nightly'
dist = '9.0.0.0-423'
username = 'HiromuHota'
}
stages {
stage('Build') {
steps {
sh '''
mvn -DskipTests clean install
'''
}
}
stage('Test') {
steps {
sh '''
mvn test
'''
}
}
stage('Deliver') {
steps {
sh '''#!/bin/bash
github-release delete --user $username --repo $repo --tag webspoon/$version
git tag -f webspoon/$version
git push -f https://${GITHUB_TOKEN}@github.com/$username/$repo.git webspoon/$version
github-release release --user $username --repo $repo --tag webspoon/$version --name "webSpoon/$version" --description "Auto-build by Jenkins on $(date +'%F %T %Z')" --pre-release
paths=()
paths+=(`find assemblies/client/target | grep "spoon.war"`)
paths+=(`find core/target | grep -E "kettle-core-$dist-[0-9]*(-sources)?\\.jar"`)
paths+=(`find engine/target | grep -E "kettle-engine-$dist-[0-9]*(-sources)?\\.jar"`)
paths+=(`find ui/target | grep -E "kettle-ui-swt-$dist-[0-9]*(-sources)?\\.jar"`)
paths+=(`find security/target | grep -E "webspoon-security-$dist-[0-9]*(-sources)?\\.jar"`)
paths+=(`find plugins/repositories/core/target | grep -E "repositories-plugin-core-$dist(-sources)?\\.jar"`)
paths+=(`find plugins/engine-configuration/ui/target | grep -E "pdi-engine-configuration-ui-$dist(-sources)?\\.jar"`)
paths+=(`find plugins/file-open-save/core/target | grep -E "file-open-save-core-$dist(-sources)?\\.jar"`)
paths+=(`find plugins/file-open-save-new/core/target | grep -E "file-open-save-new-core-$dist(-sources)?\\.jar"`)
paths+=(`find plugins/get-fields/core/target | grep -E "get-fields-core-$dist(-sources)?\\.jar"`)
paths+=(`find plugins/connections/ui/target | grep -E "connections-ui-$dist(-sources)?\\.jar"`)
for path in ${paths[@]}
do
echo $path
file=`echo $path | awk -F/ '{print $NF}'`
echo $file
github-release upload --user $username --repo $repo --tag webspoon/$version --name "$file" --file $path
done
'''
}
}
}
}