Skip to content

Instantly share code, notes, and snippets.

solvingj / jenkins.yaml
Last active Jul 10, 2020
Jenkins CASC for organization folder: Whats wrong?
View jenkins.yaml
- script: >
organizationFolder('gitbucket') {
description("All repos with Jenkinsfiles discovered on gitbucket")
organizations {
github {
View gist:87851300eb97e5aaab524d3e12eee956
import com.lesfurets.jenkins.unit.declarative.DeclarativePipelineTest
import org.junit.Before
import org.junit.jupiter.api.Test
import static
import static
class ConanArgsJPUSpec extends DeclarativePipelineTest {
solvingj / withIndex.txt
Last active Jun 14, 2020
Iterable withIndex behavior discrepancy on Jenkins
View withIndex.txt
// Run this in a Jenkins step
String jsonStr = "['zero', 'one', 'two']"
JSONArray jsonArray = new JsonSlurper().parseText(jsonStr) as JSONArray
jsonArray.withIndex().each{Object str, Integer idx -> currentBuild.echo("${idx.toString()} : ${str}")}
// OUTPUT from jenkins
// [Pipeline] echo
// null : [zero, 0]
// [Pipeline] echo
// null : [one, 1]
View failing block...
- script: >
multibranchPipelineJob('libA') {
branchSources {
git {
id = 'libA'
credentialsId = 'GIT_CREDS'
solvingj / job.log
Created May 7, 2020
casc job first run failure stacktrace
View job.log
ranch indexing
> /usr/local/bin/git rev-parse --is-inside-work-tree # timeout=10
ERROR: Workspace has a .git repository, but it appears to be corrupt.
hudson.plugins.git.GitException: Error performing git command: /usr/local/bin/git rev-parse --is-inside-work-tree
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.hasGitRepo(
solvingj / CpsScriptMock.groovy
Created May 6, 2020
Extending CpsScript Impossible?
View CpsScriptMock.groovy
// Fails to compile with:
// error: unreported exception IOException; must be caught or declared to be thrown
// But i'm throwing it right?
import org.jenkinsci.plugins.workflow.cps.CpsScript
class CpsScriptMock extends CpsScript {
CpsScriptMock() throws IOException {
solvingj / tasks.vs.json
Last active Jun 20, 2019
Current Schema of Tasks.vs.json
View tasks.vs.json
"$schema": "",
"definitions": {
"default": {
"type": "object",
"properties": {
"taskName": {
"type": "string"
"taskLabel": {
View gist:db4a7a4558744b9355555fe45f3f09e2
Updating makefiles....
Considering target file 'Makefile'.
Looking for an implicit rule for 'Makefile'.
Trying pattern rule with stem 'Makefile'.
Trying implicit prerequisite 'Makefile.o'.
Trying pattern rule with stem 'Makefile'.
Trying implicit prerequisite 'Makefile.c'.
Trying pattern rule with stem 'Makefile'.
Trying implicit prerequisite ''.
Trying pattern rule with stem 'Makefile'.
solvingj / embeddable-python-layout-and-log.txt
Last active May 2, 2019
View embeddable-python-layout-and-log.txt
user@user-laptop:~/tmp$ ls -l
total 32300
-rwxrwxrwx 1 user user 58312 May 2 14:21
-rwxrwxrwx 1 user user 12648 May 2 14:21
-rwxrwxrwx 1 user user 46528 May 2 14:21
-rwxrwxrwx 1 user user 149880 May 2 14:21
-rwxrwxrwx 1 user user 158104 May 2 14:21
-rwxrwxrwx 1 user user 27000 May 2 14:21
-rwxrwxrwx 1 user user 264568 May 2 14:21
-rwxrwxrwx 1 user user 137592 May 2 14:21
solvingj /
Last active Feb 23, 2019
Future Readme of DAG-Build (WIP) Jenkins plugin

DAG stands for Directed Acyclic Graph . This term is commonly used in software development when discussing dependency trees. In the context of Jenkins, "DAG Build" provides the necessary logic to calculate a DAG out of the existing Jenkins Dependency Graph defined in Jenkins projects for each build.

DAG Build Feature Summary
The DAG Build plugin builds adds automatic enforcement of a correct, coherent, ordered, and linear execution of a dependency graph, with support for complex fork and join scenarios. Notably, it works with both "Upstream" and "Downstream" build triggers. Historically, other strategies and mechanisms have enforced this type of deliberate, coordinated build logic within Jenkins, however they all have dramatically different designs, and thus have different characteristics.

This plugin is particularly relevant for Jenkins deployments with complex build dependency graphs featuring "diamond dependency" scenarios. Abstractly, a diamond dependency is one

You can’t perform that action at this time.