Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions declarative-examples/jenkinsfile-examples/mavenDocker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ pipeline {
* Multiline strings can be used for larger scripts. It is also possible to put scripts in your shared library
* and load them with 'libaryResource'
*/
sh """
sh '''
docker build -t ${IMAGE} .
docker tag ${IMAGE} ${IMAGE}:${VERSION}
docker push ${IMAGE}:${VERSION}
"""
'''
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ node {
echo "Building flavor ${flavor}"

//build your gradle flavor, passes the current build number as a parameter to gradle
sh "./gradlew clean assemble${flavor}Debug -PBUILD_NUMBER=${env.BUILD_NUMBER}"
sh './gradlew clean assemble${flavor}Debug -PBUILD_NUMBER=${env.BUILD_NUMBER}'

stage 'Stage Archive'
//tell Jenkins to archive the apks
archiveArtifacts artifacts: 'app/build/outputs/apk/*.apk', fingerprint: true

stage 'Stage Upload To Fabric'
sh "./gradlew crashlyticsUploadDistribution${flavor}Debug -PBUILD_NUMBER=${env.BUILD_NUMBER}"
sh './gradlew crashlyticsUploadDistribution${flavor}Debug -PBUILD_NUMBER=${env.BUILD_NUMBER}'
}

// Pulls the android flavor out of the branch name the branch is prepended with /QA_
Expand Down
2 changes: 1 addition & 1 deletion jenkinsfile-examples/msbuild/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node {

stage 'Build'
bat 'nuget restore SolutionName.sln'
bat "\"${tool 'MSBuild'}\" SolutionName.sln /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}"
bat '\"${tool \'MSBuild\'}\" SolutionName.sln /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}'

stage 'Archive'
archive 'ProjectName/bin/Release/**'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ node {
// via 'name' given for the field, 'variable:'
configFileProvider([configFile(fileId: mycfg_file, variable: 'PACKER_OPTIONS')]) {
echo " =========== ^^^^^^^^^^^^ Reading config from pipeline script "
sh "cat ${env.PACKER_OPTIONS}"
sh 'cat ${env.PACKER_OPTIONS}'
echo " =========== ~~~~~~~~~~~~ ============ "

// Access to config file opens up other possibilities like
// passing on the configuration to an external script for other tasks, like,
// for example, to set generic options that can be used for generating
// binary images using packer.
echo " =========== ^^^^^^^^^^^^ Reading config via Python... "
sh "python build_image.py ${env.PACKER_OPTIONS}"
sh 'python build_image.py ${env.PACKER_OPTIONS}'
echo " =========== ~~~~~~~~~~~~ ============ "
}
}
Expand Down
2 changes: 1 addition & 1 deletion pipeline-examples/slacknotify/slackNotify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ def notifySlack(text, channel) {
channel : channel,
username : "jenkins",
icon_emoji: ":jenkins:"])
sh "curl -X POST --data-urlencode \'payload=${payload}\' ${slackURL}"
sh 'curl -X POST --data-urlencode \'payload=${payload}\' ${slackURL}'s
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ node('second-node') {

// Look, no output directory under the root!
// pwd() outputs the current directory Pipeline is running in.
sh "ls -la ${pwd()}"
sh 'ls -la ${pwd()}'

// And look, output directory is there under first-stash!
sh "ls -la ${pwd()}/first-stash"
sh 'ls -la ${pwd()}/first-stash'
}