Commit 406127cdfd3028bb78033936792ae041a7305288
Exists in
master
and in
13 other branches
Merge branch 'mail_build_output' into 'master'
Mail Build Output
Showing
2 changed files
with
27 additions
and
2 deletions
Show diff stats
doc/release.md
| ... | ... | @@ -57,6 +57,12 @@ aws configure # enter AWS key and secret |
| 57 | 57 | ``` |
| 58 | 58 | |
| 59 | 59 | - Set up a deploy key to fetch the GitLab EE source code. |
| 60 | +- Put your email address in `~omnibus-build/.forward`. | |
| 61 | +- Test email delivery: | |
| 62 | + | |
| 63 | +```shell | |
| 64 | +echo "Subject: testing from $(uname -n)" | sendmail $(whoami) | |
| 65 | +``` | |
| 60 | 66 | |
| 61 | 67 | ### Each build |
| 62 | 68 | ... | ... |
release.sh
| 1 | -#!/bin/sh | |
| 2 | -make release | |
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +# Generate a build ID based on the current time and the PID of this script | |
| 4 | +build="$(date '+%s')-$$" | |
| 5 | + | |
| 6 | +# Do the build and capture its output in a .log file | |
| 7 | +make release 2>&1 | tee -a ${build}.log | |
| 8 | + | |
| 9 | +# Check the exit status of `make`, not `tee` | |
| 10 | +if [[ ${PIPESTATUS[0]} -eq 0 ]]; then | |
| 11 | + subject="omnibus-gitlab build ${build} SUCCESS" | |
| 12 | +else | |
| 13 | + subject="omnibus-gitlab build ${build} FAIL" | |
| 14 | +fi | |
| 15 | + | |
| 16 | +# We assume that email to the current system user will somehow reach the right | |
| 17 | +# human eyes | |
| 18 | +sendmail $(whoami) <<EOF | |
| 19 | +Subject: ${subject} | |
| 20 | +$(tail ${build}.log) | |
| 21 | +EOF | ... | ... |