Skip to content

Instantly share code, notes, and snippets.

@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/*)
@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 / Dockerfile
Last active October 17, 2024 06:30
Docker scratch x509 fix
FROM golang:alpine as builder
WORKDIR /app
#the following 2 steps are optional if your image does not already have the certificate
# package installed, golang:alpine now seems to have it. But a more base image could be missing it.
#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