-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.groovy
53 lines (52 loc) · 1.67 KB
/
Jenkinsfile.groovy
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
pipeline {
agent any
stages {
stage('Code pull') {
when {
expression {
String s = "NOT MERGED"
if(params.merged) {
s = "MERGED"
}
echo "PR CURRENT STATUS: ${params.current_status}"
echo "PR MERGED STATUS: $s"
return params.current_status == "closed" && params.merged == true
}
}
steps {
git 'https://github.com/RanaRanvijaySingh/FlutterStarter.git'
}
}
stage('Build') {
when {
expression { return params.current_status == "closed" && params.merged == true }
}
steps {
sh '''
#!/bin/sh
flutter build apk --debug
'''
}
}
stage('Test') {
when {
expression { return params.current_status == "closed" && params.merged == true }
}
steps {
sh 'flutter test'
}
}
stage('Publish') {
when {
expression { return params.current_status == "closed" && params.merged == true }
}
steps {
appCenter apiToken: 'f51cf29ba6b2234a84c999bc37348db84624c615',
ownerName: 'ranaranvijaysingh9-gmail.com',
appName: 'Flutter-Crystal-Cruise',
pathToApp: 'build/app/outputs/apk/debug/app-debug.apk',
distributionGroups: 'flutter-crystal-cruise'
}
}
}
}