This repository has been archived by the owner on Feb 10, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Reinhardt, Martin
committed
May 22, 2017
1 parent
db5701a
commit 26736fb
Showing
1 changed file
with
42 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,51 @@ | ||
properties properties: [ | ||
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '10']], | ||
[$class: 'GithubProjectProperty', displayName: '', projectUrlStr: 'https://github.com/hypery2k/nativescript-urlhandler'], | ||
disableConcurrentBuilds() | ||
] | ||
|
||
node('nativescript') { | ||
def buildNumber = env.BUILD_NUMBER | ||
def branchName = env.BRANCH_NAME | ||
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 "branch name is $branchName" | ||
echo "PATH is $env.PATH" | ||
|
||
try { | ||
stage('Checkout') { | ||
checkout scm | ||
timeout(60) { | ||
node('nativescript') { | ||
def buildNumber = env.BUILD_NUMBER | ||
def branchName = env.BRANCH_NAME | ||
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 "branch name is $branchName" | ||
echo "PATH is $env.PATH" | ||
|
||
try { | ||
stage('Checkout') { | ||
checkout scm | ||
} | ||
|
||
stage('Build') { | ||
sh "npm run clean && npm run build" | ||
} | ||
|
||
stage('Test') { | ||
sh "npm run test" | ||
junit 'target/junit-report/junitresults-*.xml' | ||
} | ||
|
||
stage('End2End Test') { | ||
sh "npm run e2e" | ||
} | ||
|
||
stage('Publish NPM snapshot') { | ||
def currentVersion = sh(returnStdout: true, script: "npm version | grep \"{\" | tr -s ':' | tr '_' '-' | cut -d \"'\" -f 4").trim() | ||
def newVersion = sh(returnStdout: true, script: "echo ${currentVersion}-${branchName}-${buildNumber} | tr '_' '-'").trim() | ||
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 | ||
} | ||
|
||
stage('Build') { | ||
sh "npm run clean && npm run build" | ||
} | ||
|
||
stage('Test') { | ||
sh "npm run test" | ||
junit 'target/junit-report/junitresults-*.xml' | ||
} | ||
|
||
stage('End2End Test') { | ||
sh "npm run e2e" | ||
} | ||
|
||
stage('Publish NPM snapshot') { | ||
def currentVersion = sh(returnStdout: true, script: "npm version | grep \"{\" | tr -s ':' | tr '_' '-' | cut -d \"'\" -f 4").trim() | ||
def newVersion = sh(returnStdout: true, script: "echo ${currentVersion}-${branchName}-${buildNumber} | tr '_' '-'").trim() | ||
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 | ||
} | ||
} | ||
|