Skip to content

Instantly share code, notes, and snippets.

View toolmantim's full-sized avatar
:shipit:
🎉

Tim Lucas toolmantim

:shipit:
🎉
View GitHub Profile

Knapsack Pro Queue Mode Capybara Screenshot Bug Test

Recreates the Capybara Screenshot bug.

Note: this can be fixed by switching to mattheworiordan/capybara-screenshot#205

-gem 'capybara-screenshot'
+gem 'capybara-screenshot', git: 'https://github.com/ArturT/capybara-screenshot.git',
+                           branch: 'fix-reporter_module-loaded-twice'
@toolmantim
toolmantim / 0-readme.md
Last active May 25, 2021 11:49
Using rvm and node on Ubuntu with Buildkite Agent

Firstly, you'll need to install rvm as the buildkite-agent user:

sudo su buildkite-agent
curl -sSL https://get.rvm.io | bash -s stable
source /var/lib/buildkite-agent/.rvm/scripts/rvm
rvm install 2.4.0 && rvm use 2.4.0 && gem install bundler

Secondly, make rvm available to your build commands by adding the following pre-command Buildkite Agent hook:

@toolmantim
toolmantim / Dockerfile
Created February 17, 2017 06:23
An example golang-based Buildkite Agent 2.x Docker image with custom pre-checkout hook for Go projects
FROM golang:1.8
RUN apt-get update && \
apt-get install -y apt-transport-https \
&& echo 'deb https://apt.buildkite.com/buildkite-agent stable main' > /etc/apt/sources.list.d/buildkite-agent.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32A37959C2FA5C3C99EFBC32A79206696452D198 \
&& apt-get update \
&& apt-get install -y buildkite-agent
COPY pre-checkout.sh /etc/buildkite-agent/hooks/pre-checkout
@toolmantim
toolmantim / aws-ec2-cli-example.bash
Last active February 14, 2017 01:03
How to manually get Buildkite Elastic CI Stack instances to terminate if they're stuck in Terminating:Wait state
# Find the ASG name
aws autoscaling describe-auto-scaling-groups \
--query 'AutoScalingGroups[].AutoScalingGroupName'
# Find the lifecycle hook name
aws autoscaling describe-lifecycle-hooks \
--auto-scaling-group-name="$ASG_NAME" \
--query 'LifecycleHooks[].LifecycleHookName'
# Find the terminating:wait instance ids
@toolmantim
toolmantim / 01-extract-commit-and-sig.sh
Created September 7, 2016 00:57
How to manually verify a signed git commit with GPG. This assumes you have GPG installed, and you have the public key added to the default keyring.
$ git cat-file -p 1b51f44d6b1e6c6eff3302a4af5a2b983a5d2161
tree fc069c67c550c449ff001fec804ad98c04c128da
parent bf17d1df5061aa67e4647fa3f7f3abd2cbe045ee
author Tim Lucas <t@toolmantim.com> 1473126017 +1000
committer Tim Lucas <t@toolmantim.com> 1473126017 +1000
gpgsig -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJXzh6fAAoJEEWaob2jtb+GzVEQAIDh2MFyF90ui00/hssG2ehW
cKImqo5VvDmv+j9oo+QL5MiH4Xv/pJ0VgcdTksmWnXx5+YyT1GsnnGkHg84Z/r/C
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15G31</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
@toolmantim
toolmantim / kiteviewer.js
Created August 15, 2016 23:27
An example outline of a custom public front-end for your Buildkite builds
// ┌───────────────────────────┐ ┌────────────┐ ┌─────────────────────────┐
// │ github.com/org/project │ │ Buildkite │ │ https://kiteviewer │
// └───────────────────────────┘ └────────────┘ └─────────────────────────┘
// │ │ │
// ├────────PR opened / ──────▶ │
// │ fork push │ Events via │
// │ webhook └────────webhooks───────▶
// │ │
// │ POST │
// ◀─────────────────────commit ──────────────────────┤
@toolmantim
toolmantim / Dockerfile
Last active August 14, 2016 00:15
Example minimum Docker image for Buildkite Agent
FROM alpine:3.4
RUN apk add --no-cache \
tini \
curl \
wget \
bash \
git \
perl \
openssh-client
@toolmantim
toolmantim / pipeline.bash
Created July 30, 2016 07:14
Demonstration of how to do environment variable substitution with buildkite-agent 2.x (in 3.x env var support is built-in)
#!/bin/bash
set -euo pipefail
# Demonstration of how to do environment variable substitution with
# buildkite-agent 2.x (in 3.x env var support is built-in)
#
# To use, save this file as .buildkite/pipeline.bash, chmod +x, and
# then set your first pipeline step to run this and pipe it into
# pipeline upload:
@toolmantim
toolmantim / pipeline.sh
Last active December 8, 2022 07:19
Ensuring Buildkite pipeline steps run on the same agent, using a dynamic pipeline generator script
#!/bin/bash
# Outputs a pipeline that targets agents that have the same 'name' meta-data
# value as the step that does the pipeline upload. This means that all the
# steps will run on the same agent machine, assuming that the 'name' meta-data
# value is unique to each agent.
#
# Each agent needs to be configured with meta-data like so:
#
# meta-data="name=<unique-name>"