Forked from eriadam/example-jenkinsfile-pipeline.groovy
Created
February 15, 2019 12:29
-
-
Save brunocrt/0d0e8e51b213d9d809e18e14d98b4e39 to your computer and use it in GitHub Desktop.
Revisions
-
Adam Eri revised this gist
Jan 11, 2018 . 1 changed file with 27 additions and 31 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,64 +4,60 @@ pipeline { agent any stages { stage('Checkout') { steps { checkout scm } } stage('Dependecies') { steps { sh '/usr/local/bin/pod install' } } stage('Running Tests') { steps { parallel ( "Unit Tests": { sh 'echo "Unit Tests"' sh 'fastlane scan' }, "UI Automation": { sh 'echo "UI Automation"' } ) } } stage('Documentation') { when { expression { env.BRANCH_NAME == 'develop' } } steps { // Generating docs sh 'jazzy' // Removing current version from web server sh 'rm -rf /path/to/doc/ios' // Copy new docs to web server sh 'cp -a docs/source/. /path/to/doc/ios' } } } post { always { // Processing test results junit 'fastlane/test_output/report.junit' // Cleanup sh 'rm -rf build' } success { notifyBuild() } failure { notifyBuild('ERROR') } } -
Adam Eri revised this gist
May 31, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -61,7 +61,6 @@ pipeline { notifyBuild() } failure { // Slack notification about the failure notifyBuild('ERROR') } -
Adam Eri revised this gist
May 31, 2017 . 1 changed file with 13 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,19 +23,20 @@ pipeline { } } stage('Generating Docs') { steps { parallel ( "Jazzy": { sh 'jazzy' sh 'rm -rf /srv/deploy/bikemap-docs/ios/source' sh 'cp -a docs/source/. /srv/deploy/bikemap-docs/ios/reference' }, "Mkdocs": { sh 'cd docs/concepts && mkdocs build' sh 'rm -rf /srv/deploy/bikemap-docs/ios/concepts' sh 'cp -a docs/concepts/site/. /srv/deploy/bikemap-docs/ios/concept' } ) } } -
Adam Eri created this gist
May 26, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,100 @@ #!groovy pipeline { agent any stages { stage('Checkout') { steps { checkout scm } } stage('Dependecies') { steps { sh '/usr/local/bin/pod update' } } stage('Running Tests') { steps { echo 'Running Tests' sh 'fastlane scan' } } stage('Generating Docs') { steps { // Jazzy for reference. sh 'jazzy' // MKDocs for high-level concepts sh 'mkdocs build' // Copying docs to public folder sh 'rm -rf /srv/deploy/docs/ios/concepts' sh 'rm -rf /srv/deploy/docs/ios/source' sh 'cp -a docs/concepts/site/. /srv/deploy/docs/ios/concept' sh 'cp -a docs/source/. /srv/deploy/docs/ios/reference' } } stage('Distribution') { steps { // Building and packaging the app sh 'fastlane gym --silent' // Uploading to TestFlight/Hockey/etc. sh 'fastlane deliver' } } } post { always { junit 'test_output/report.junit' sh 'rm -rf build' } success { // Slack notification about the success notifyBuild() } failure { // Slack notification about the failure notifyBuild('ERROR') } } } // Slack notification with status and code changes from git def notifyBuild(String buildStatus = 'SUCCESSFUL') { buildStatus = buildStatus def colorName = 'RED' def colorCode = '#FF0000' def subject = "${buildStatus}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'" def changeSet = getChangeSet() def message = "${subject} \n ${changeSet}" if (buildStatus == 'SUCCESSFUL') { color = 'GREEN' colorCode = '#00FF00' } else { color = 'RED' colorCode = '#FF0000' } slackSend (color: colorCode, message: message) } @NonCPS // Fetching change set from Git def getChangeSet() { return currentBuild.changeSets.collect { cs -> cs.collect { entry -> "* ${entry.author.fullName}: ${entry.msg}" }.join("\n") }.join("\n") }