Skip to content

Instantly share code, notes, and snippets.

@michaelboke
michaelboke / Dockerfile
Last active April 23, 2024 17:50
Docker scratch x509 fix
FROM golang:alpine as builder
WORKDIR /app
RUN apk update && apk upgrade && apk add --no-cache ca-certificates
RUN update-ca-certificates
ADD main.go /app/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o app .
FROM scratch
COPY --from=builder /app/app .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
@michaelboke
michaelboke / git-release.sh
Created April 3, 2017 13:43
summarize jira tickets between branches, with title lookup
#!/usr/bin/env bash
TARGET="master"
SOURCE="develop"
USERNAME="jirausername"
PASSWORD="jirapassword"
FIELD="summary"
for ISSUE in `git log $TARGET..$SOURCE --pretty=oneline | perl -ne '{ /(\w+)-(\d+)/ && print "$1-$2\n" }' | sort | uniq`; do
JSON=$(curl -s -u $USERNAME:$PASSWORD -X GET https://jira.voiceworks.com/rest/api/latest/issue/$ISSUE?fields=summary)
@michaelboke
michaelboke / gist:4986027
Last active December 13, 2015 22:39
Jenkins branch job create/delete hook for git post-receive
#!/bin/bash
# Copyright (c) 2013 Michael boke
#
# This hook creates new jobs for each new branch in the jenkins continuous integration tool.
# Besides creating the job if needed, the user who pushed is added to the job's email list if they were not already there.
while read oldrev newrev refname ; do
case "$refname" in
refs/tags/*)