Skip to content

Instantly share code, notes, and snippets.

View lox's full-sized avatar

Lachlan Donald lox

View GitHub Profile
@lox
lox / pipeline.yml
Last active May 3, 2018 05:28
Test local plugins
steps:
- label: "Test local plugin"
agents:
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
plugins:
"/Users/lachlan/Projects/buildkite/docker-compose-buildkite-plugin": ~
@lox
lox / Dockerfile
Last active April 23, 2018 22:53
Test caching shared base image in docker-compose-buildkite-plugin
FROM alpine:3.3
RUN echo "CACHE MISS" && sleep 10
RUN apk update && \
apk add --no-cache openssl && \
rm -rf /var/cache/apk/*
RUN echo "CACHE MISS" && sleep 10
RUN openssl req -x509 -nodes -newkey rsa:4096 -keyout /key.pem -out /certificate.pem -days 720 -subj "/C=US/ST=State/L=City/O=Department/OU=Company/CN=localhost.localdomain"
RUN echo "CACHE MISS" && sleep 10
@lox
lox / graphql.go
Created April 19, 2018 00:51
A very simply golang Buildkite GraphQL client
package graphql
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/http/httputil"
"net/url"
@lox
lox / pipeline.yml
Last active April 16, 2018 00:44
Test large artifact downloads
steps:
- label: "Generate artifacts"
command:
- dd if=/dev/zero of=output.dat bs=1m count=10
- buildkite-agent artifact upload output.dat s3://lox-buildkite-artifacts/$BUILDKITE_JOB_ID
- wait
- label: "Download artifacts"
commands:
@lox
lox / Dockerfile
Last active April 15, 2018 11:05
Docker and Docker-Compose Example Pipelines
FROM ubuntu:latest
@lox
lox / plugin_read_list.sh
Created February 24, 2018 04:19
Helpers for Buildkite Plugins
# Reads either a value or a list from plugin config
function plugin_read_list() {
local prefix="BUILDKITE_PLUGIN_GOLANG_BUILD_$1"
local parameter="${prefix}_0"
if [[ -n "${!parameter:-}" ]]; then
local i=0
local parameter="${prefix}_${i}"
@lox
lox / InstallBuildkiteAgent.ps1
Last active February 23, 2018 09:40
Install buildkite-agent in Windows as a Service
Param(
$agentVersion = "3.0-beta.39",
$agentToken = "xxx",
$agentTags = "windows",
$installDir = "C:\buildkite"
)
## Verify we are elevated
## https://superuser.com/questions/749243/detect-if-powershell-is-running-as-administrator
@lox
lox / 0 - README.md
Last active October 19, 2017 02:12
Interpolation test

Create a pipeline with https://gist.github.com/370a05e0bf7645bc6728ca18b0b23295.git with and a single upload step with buildkite-agent pipeline upload buildkite-pipeline.yml

@lox
lox / pipeline.yml
Last active September 26, 2017 01:35
steps:
- command: "echo hello world!"
- block: "Request Release"
fields:
- text: "S3 File Path"
key: "file-path"
required: true
hint: |
What is the file path/s for this import? Here is a list of files:
blah.txt
@lox
lox / buildkite-cli.md
Created August 12, 2017 03:24
A plan for a buildkite-cli tool.

Buildkite CLI

A cli tool for interacting with buildkite.com from your terminal.

buildkite configure

Sets up the tool, asks for a Buildkite graphql token and a default organization.