Commit fff945f0 authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files
parents ceee1417 f73a3bc6
PROJECT=gitlab-runner
RELEASE_BUCKET=downloads-packages
RELEASE_BUCKET_REGION=eu-west-1
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 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: md5 s3_sync
md5:
find pkg -name '*.json' -exec cat {} \;
s3_sync:
aws s3 sync pkg/ s3://${RELEASE_BUCKET} --acl public-read --region ${RELEASE_BUCKET_REGION}
gitlab-runner Omnibus project gitlab-runner Omnibus project
============================= =============================
   
See [doc/README.md](doc/README.md).
Below is the auto-generated README from omnibus-ruby. Below is the auto-generated README from omnibus-ruby.
   
This project creates full-stack platform-specific packages for This project creates full-stack platform-specific packages for
......
# Omnibus packages for GitLab Runner # Omnibus packages for GitLab Runner
- [Installation instructions](install/README.md)
# Installing GitLab Runner
Below we describe the one-time steps you need to perform to set up a new
gitlab-runner instance.
## Ubuntu 12.04, 14.04 and Centos 6
```
# Create the user that will run your builds
sudo useradd -m -r gitlab-runner
# Register your runner instance with a GitLab CI Coordinator
sudo /opt/gitlab-runner/bin/setup -C /home/gitlab-runner
# Install and start the gitlab-runner Upstart script
sudo cp /opt/gitlab-runner/doc/install/upstart/gitlab-runner.conf /etc/init/
sudo service gitlab-runner start
```
The runner will write log messages via Upstart to
`/var/log/upstart/gitlab-runner.log`.
# Upstart configuration file for gitlab-ci-runner
# Control with:
#
# sudo service gitlab-runner start
#
description "GitLab Runner"
author "GitLab B.V."
start on runlevel [2345]
env HOME=/home/gitlab-runner
# Always restart the runner if it dies / exits
respawn
# Log to /var/log/upstart/
console log
# Run the process as gitlab-runner:gitlab-runner
setuid gitlab-runner
setgid gitlab-runner
script
export HOME=$HOME
exec /opt/gitlab-runner/bin/runner -C $HOME
end script
#!/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 --binstubs
# 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-runner build ${build} SUCCESS"
else
subject="omnibus-gitlab-runner 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