Commit eff42b043b174fde6d2875d83cc6afb46151c122

Authored by Jacob Vosmaer
1 parent bcc4ccbf

Add email notifications to release.sh

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
... ...