Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
test JENKINS-48061 no tag, no branch
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Apr 6, 2018
1 parent b1c67a3 commit 96ae30e
Showing 1 changed file with 51 additions and 16 deletions.
67 changes: 51 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,53 @@
#!groovy

// Don't test plugin compatibility to other Jenkins versions
// Allow failing tests to retry execution
// buildPlugin(failFast: false)

// Test plugin compatbility to pom defined version (null) and latest Jenkins weekly
// Allow failing tests to retry execution
// Run checkstyle and save the output, mark unstable on any checkstyle warning
// Run findbugs and save the output, mark unstable on any findbugs warning
buildPlugin(jenkinsVersions: [null, '2.73.1', '2.78'],
checkstyle: [run:true, archive:true, unstableTotalAll: '0'],
findbugs: [run:true, archive:true, unstableTotalAll: '0'],
failFast: false
)

// See https://github.com/jenkins-infra/pipeline-library/blob/master/README.adoc
// for detailed description of the arguments available with buildPlugin
@Library('git-modern-3.8.0@5093f89ac0057a471081ff5a5bf94c20f9acae97') _

import com.markwaite.Assert
import com.markwaite.Build

import static groovy.json.JsonOutput.*

def branch = 'JENKINS-48061-no-tag-no-branch'
def repo = 'https://github.com/MarkEWaite/hello-world-plugin'

import java.util.Random
def random = new Random()

def implementations = [ 'git', 'jgit', 'jgitapache' ]
/* Randomize order of implementations */
Collections.shuffle(implementations, random)

def tasks = [ : ]

def checkout_result = [ : ]

def first = ""

for (int i = 0; i < implementations.size(); ++i) {
def gitImplementation = implementations[i]
tasks[gitImplementation] = {
node {
stage("Check ${gitImplementation}") {
def implementation = gitImplementation == "git" ? "Default" : gitImplementation
checkout([$class: 'GitSCM',
branches: [[name: branch]],
browser: [$class: 'GithubWeb', repoUrl: repo],
extensions: [
[$class: 'CloneOption', honorRefspec: true, noTags: true],
],
gitTool: implementation,
userRemoteConfigs: [[refspec: "+refs/heads/${branch}:refs/remotes/origin/${branch}", url: repo]]
]
)

/* Call the ant build. */
def my_step = new com.markwaite.Build()
my_step.ant 'info'
def my_check = new com.markwaite.Assert()
my_check.logContains('.*user dir is .*', 'Ant output missing user dir report')
}
}
}
}

parallel(tasks)

0 comments on commit 96ae30e

Please sign in to comment.