Skip to content

Instantly share code, notes, and snippets.

View rsandell's full-sized avatar

Robert Sandell rsandell

View GitHub Profile
@rsandell
rsandell / examplePipeline.groovy
Created October 25, 2016 12:44
Example declarative pipeline
pipeline {
agent docker: "maven:3.3.9-jdk-8"
environment {
MAVEN_OPTS = "-Xmx1024m"
}
stages {
stage("Build") {
@rsandell
rsandell / install-plugins.groovy
Created August 25, 2016 10:59
A script that installs all missing plugins from a list produced by a Jenkins support bundle
class Consts {
static final String jar = "/home/rsandell/jenkins/cje2/war/WEB-INF/jenkins-cli.jar"
static final String java = "/home/rsandell/java/jdk1.8.0_73/bin/java"
static final String url = "http://bobby.local:8081"
static final String cli = "${java} -jar ${jar} -s ${url}"
}
final String remotePluginsFile = "/home/rsandell/jenkins/active.txt"
def getInstalledPlugins() {
"${Consts.cli} list-plugins".execute().text.readLines().collect { String line ->

Keybase proof

I hereby claim:

  • I am rsandell on github.
  • I am rsandell (https://keybase.io/rsandell) on keybase.
  • I have a public key ASBY1X9LAa5-ACkENkkoa2yT50CCy32rNtCrrkayDIKFogo

To claim this, I am signing this object:

@rsandell
rsandell / workflow-gdsl.groovy
Last active October 7, 2015 15:09
A Jenkins workflow script that generates a somewhat working gdsl file that can be used to get code completion on workflow steps in Groovy files in IntelliJ IDEA.
/*
* The MIT License
*
* Copyright (c) 2015 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@rsandell
rsandell / wf-jenkins.groovy
Created October 5, 2015 17:32
A script that runs a groovy file as a workflow on a locally running Jenkins.
#!/usr/bin/env groovy
/*
* The MIT License
*
* Copyright (c) 2015 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@rsandell
rsandell / bfa_categories.js
Created March 11, 2014 12:21
A Node.js script that aggregates Jenkins Build Failure Analyzer plugin statistics from MongoDB to Graphite, failure categories per hour
/*
The MIT License
Copyright 2014 Sony Mobile Communications AB. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@rsandell
rsandell / known_vs_unknown.js
Last active August 29, 2015 13:57
A Node.js script that aggregates Jenkins Build Failure Analyzer plugin statistics from MongoDB to Graphite, known and unknown failures per hour.
/*
The MIT License
Copyright 2014 Sony Mobile Communications AB. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is