diff --git a/doc/release.md b/doc/release.md index 0bbfd64..fc46bbd 100644 --- a/doc/release.md +++ b/doc/release.md @@ -57,6 +57,12 @@ aws configure # enter AWS key and secret ``` - Set up a deploy key to fetch the GitLab EE source code. +- Put your email address in `~omnibus-build/.forward`. +- Test email delivery: + +```shell +echo "Subject: testing from $(uname -n)" | sendmail $(whoami) +``` ### Each build diff --git a/release.sh b/release.sh index 29e4591..dde3566 100755 --- a/release.sh +++ b/release.sh @@ -1,2 +1,21 @@ -#!/bin/sh -make release +#!/bin/bash + +# Generate a build ID based on the current time and the PID of this script +build="$(date '+%s')-$$" + +# Do the build and capture its output in a .log file +make release 2>&1 | tee -a ${build}.log + +# Check the exit status of `make`, not `tee` +if [[ ${PIPESTATUS[0]} -eq 0 ]]; then + subject="omnibus-gitlab build ${build} SUCCESS" +else + subject="omnibus-gitlab build ${build} FAIL" +fi + +# We assume that email to the current system user will somehow reach the right +# human eyes +sendmail $(whoami) <