Skip to content

Instantly share code, notes, and snippets.

@rtyler
rtyler / gist:3041462
Created Jul 3, 2012
Rakefile for puppet-lint in CI
View gist:3041462
LINT_IGNORES = ['rvm']
namespace :lint do
desc "Check puppet module code style."
task :ci do
begin
require 'puppet-lint'
rescue LoadError
fail 'Cannot load puppet-lint, did you install it?'
end
@rtyler
rtyler / upload-to-azure.sh
Created Jan 4, 2018
A bash script which supports uploading blobs to Azure Storage: ./upload-to-azure.sh [filename]
View upload-to-azure.sh
#!/usr/bin/env bash
FILENAME=${1}
# expected to be defined in the environment
# - AZURE_STORAGE_ACCOUNT
# - AZURE_CONTAINER_NAME
# - AZURE_ACCESS_KEY
# inspired by
View keybase.md

Keybase proof

I hereby claim:

  • I am rtyler on github.
  • I am rtyler (https://keybase.io/rtyler) on keybase.
  • I have a public key whose fingerprint is 9062 865A 46E8 C749 2BF1 88D7 1426 C7DC 3F51 E16F

To claim this, I am signing this object:

@rtyler
rtyler / Jenkinsfile
Last active Aug 27, 2021
Docker in docker within Jenkins on Kubernetes. Eat at Arby's.
View Jenkinsfile
pipeline {
agent {
kubernetes {
label 'dind'
defaultContainer 'docker'
yaml """
---
apiVersion: v1
kind: Pod
metadata:
@rtyler
rtyler / 0_console.log
Created Dec 9, 2016
Demonstrating setters/getters in a Pipeline Shared Library
View 0_console.log
Started by user rtyler
Loading library pipeline-library@acme-test
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git://github.com/jenkins-infra/pipeline-library.git # timeout=10
Fetching upstream changes from git://github.com/jenkins-infra/pipeline-library.git
> git --version # timeout=10
> git fetch --tags --progress git://github.com/jenkins-infra/pipeline-library.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/acme-test^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/acme-test^{commit} # timeout=10
@rtyler
rtyler / github-backup.py
Created Jan 29, 2021
A simple Python script for copying an organization's repositories
View github-backup.py
#!/usr/bin/env python3
#
# Requires https://pygithub.readthedocs.io/en/latest
#
# Set the GITHUB_TOKEN to a personal access token with all repo scopes
import os
import subprocess
import sys
@rtyler
rtyler / 0_readme.adoc
Created Dec 7, 2020
I want your Jenkins declarative pipeline!
View 0_readme.adoc

I want your Declarative Pipeline!

I’m working on a grammar and parser for declarative Jenkins Pipelines called Jenkins Declarative Parser. In order to make this parser work well, I need real-world declarative `Jenkinsfile`s, that’s where you come in!

If you have a Jenkinsfile which you’re allowed to share publicly, follow these steps:

  • Create a new directory inside the data/valid directory

  • Add your Jenkinsfile to the directory

@rtyler
rtyler / 0_about.adoc
Created Nov 27, 2020
An example of Otto running its own tests
View 0_about.adoc

Sorta-self-hosted Otto

Below is a transcript from a local installation of Otto with the parser service, the "local-orchestrator" service, a local agent, and steps. This is fairly simple, but it represents an end-to-end integration test of Otto 👏

Running

  1. Clone Otto

  2. cargo build

  3. make steps build the steps libraries

@rtyler
rtyler / complex.groovy
Created Nov 7, 2020
Exploring syntax for more root verbs in Otto (.groovy just for syntax highlighting)
View complex.groovy
use stdlib
environment {
}
pipeline {
// Parallel will build all sub-stages concurrently without stopping if one
// fails. Any of the stages failing will halt the pipeline after the parallel
// however
parallel {
@rtyler
rtyler / 0_prereq.adoc
Last active Oct 29, 2020
Simple Otto step library testing
View 0_prereq.adoc

Prerequisites

  • Have a rust compiler set up

  • make steps will package all the steps up for you

  • mkdir tmp && for f in *.tar.gz; do tar -zxvf $f -C tmp; done will prepare the tmp/ directory with those step libraries extracted

Then you should be able ro invoke the test-pipeline.yml with the following command: