forked from katzer/cordova-plugin-email-composer
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathJenkinsfile
54 lines (43 loc) · 1.9 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
properties properties: [
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '10']],
[$class: 'GithubProjectProperty', displayName: '', projectUrlStr: 'https://github.com/hypery2k/cordova-email-plugin/'],
]
node {
node('cordova') {
def buildNumber = env.BUILD_NUMBER
def workspace = env.WORKSPACE
def buildUrl = env.BUILD_URL
// PRINT ENVIRONMENT TO JOB
echo "workspace directory is $workspace"
echo "build URL is $buildUrl"
echo "build Number is $buildNumber"
echo "PATH is $env.PATH"
try {
stage('Checkout') {
checkout scm
}
stage('Build') {
sh "npm install"
sh "npm run clean && npm run setupDemoApp"
sh "export PLATFORM=android && npm run build"
sh "export PLATFORM=ios && npm run build"
}
stage('Test') {
//sh "export PLATFORM=android && npm run test"
//sh "export PLATFORM=ios && npm run test"
}
stage('Integration-Test') {
//sh "export PLATFORM=android && npm run e2e"
//sh "export PLATFORM=ios && npm run e2e"
}
stage('Publish NPM snapshot') {
def currentVersion = sh(returnStdout: true, script: "npm version | grep \"{\" | tr -s ':' | cut -d \"'\" -f 4").trim()
def newVersion = "${currentVersion}-${buildNumber}"
sh "npm version ${newVersion} --no-git-tag-version && npm publish --tag next"
}
} catch (e) {
mail subject: "${env.JOB_NAME} (${env.BUILD_NUMBER}): Error on build", to: 'github@martinreinhardt-online.de', body: "Please go to ${env.BUILD_URL}."
throw e
}
}
}