Skip to content

Instantly share code, notes, and snippets.

@bartekj
bartekj / Jenkinsfile.groovy
Created October 3, 2019 15:42 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@bartekj
bartekj / git-cleanup
Created August 21, 2018 13:20 — forked from larowlan/git-cleanup
Clean up old git branches
#!/bin/bash
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v 'master$' | xargs git branch -d
@bartekj
bartekj / digicertacm.sh
Created May 23, 2018 11:51 — forked from jgamblin/digicertacm.sh
Automating Digicert Certificates Into AWS ACM
#!/bin/bash
#Required
apikey=
domain=
commonname=$1
orgid=
#Change to your company details
country=
- block:
- name: Check and register jenkins version using initpasswordfile
command: >
java -jar /opt/jenkins-cli.jar -http -s http://{{ jenkins_hostname }}:{{ jenkins_http_port }}/
-auth @/var/lib/jenkins/secrets/initialAdminAuth
version
register: jenkins_version
- set_fact:
jenkins_version: "{{ jenkins_version.stdout }}"

Keybase proof

I hereby claim:

  • I am bartekj on github.
  • I am natur (https://keybase.io/natur) on keybase.
  • I have a public key whose fingerprint is 104D 6F84 4E5A 64BC 4466 1F9A 731A 5845 68ED 51D1

To claim this, I am signing this object:

@bartekj
bartekj / 0_reuse_code.js
Created November 21, 2015 20:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console