Commit ad15e5de authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Vendor Makefile and release.sh from omnibus-gitlab

Source: https://gitlab.com/gitlab-org/omnibus-gitlab
Revision: 1d08929f1f77e719fb360e6f443048ae141880e8
parent 2129bcf3
PROJECT=gitlab
RELEASE_BUCKET=downloads-packages
RELEASE_BUCKET_REGION=eu-west-1
SECRET_DIR:=$(shell openssl rand -hex 20)
PLATFORM_DIR:=$(shell ruby -rjson -e 'puts JSON.parse(`bin/ohai`).values_at("platform", "platform_version").join("-")')
build:
bin/omnibus build ${PROJECT} --override append_timestamp:false --log-level info
do_release: no_changes on_tag purge build move_to_platform_dir sync
no_changes:
git diff --quiet HEAD
on_tag:
git describe --exact-match
purge:
# Force a new clone of gitlab-rails because we change remotes for CE/EE
rm -rf /var/cache/omnibus/src/gitlab-rails
# Force a new download of Curl's certificate bundle because it gets updated
# upstream silently once every while
rm -rf /var/cache/omnibus/cache/cacert.pem
# Clear out old packages to prevent uploading them a second time to S3
rm -rf /var/cache/omnibus/pkg
mkdir -p pkg
(cd pkg && find . -delete)
# Instead of pkg/gitlab-xxx.deb, put all files in pkg/ubuntu/gitlab-xxx.deb
move_to_platform_dir:
mv pkg ${PLATFORM_DIR}
mkdir pkg
mv ${PLATFORM_DIR} pkg/
sync: move_to_secret_dir md5 s3_sync
move_to_secret_dir:
if support/is_gitlab_ee.sh || support/is_gitlab_com.sh ; then \
mv pkg ${SECRET_DIR} \
&& mkdir pkg \
&& mv ${SECRET_DIR} pkg/ \
; fi
md5:
find pkg -name '*.json' -exec cat {} \;
s3_sync:
aws s3 sync pkg/ s3://${RELEASE_BUCKET} --acl public-read --region ${RELEASE_BUCKET_REGION}
#!/bin/bash
# Generate a build ID based on the current time and the PID of this script
build="$(date '+%s')-$$"
# Install/update gems for omnibus-ruby
bundle install
# Do the build and capture its output in a .log file
make do_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
tail -n 20 ${build}.log | sed 's/.*\r//' | mail -s "${subject}" $(cat ~/.forward)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment