Commit 72dd34a2 authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Initial commit

parents
*.gem
.bundle
.kitchen/
.kitchen.local.yml
vendor/bundle
pkg/*
.vagrant
bin/*
files/**/cache/
vendor/cookbooks
driver:
name: vagrant
forward_agent: yes
customize:
cpus: 2
memory: 2048
synced_folders:
- ['.', '/home/vagrant/gitlab-runner']
provisioner:
name: chef_zero
require_chef_omnibus: 11.16.4
platforms:
- name: centos-7.0
run_list: yum-epel::default
- name: centos-6.5
run_list: yum-epel::default
- name: centos-5.10
run_list: yum-epel::default
- name: debian-7.2.0
run_list: apt::default
- name: debian-6.0.8
run_list: apt::default
- name: freebsd-10.0
run_list: freebsd::portsnap
- name: freebsd-9.2
run_list:
- freebsd::portsnap
- freebsd::pkgng
- name: ubuntu-14.04
run_list: apt::default
- name: ubuntu-12.04
run_list: apt::default
- name: ubuntu-11.04
run_list: apt::default
- name: ubuntu-10.04
run_list: apt::default
suites:
- name: default
run_list: omnibus::default
attributes:
omnibus:
build_user: vagrant
build_user_group: vagrant
build_user_password: vagrant
install_dir: /opt/gitlab-runner
source 'https://api.berkshelf.com'
cookbook 'omnibus'
# Uncomment to use the latest version of the Omnibus cookbook from GitHub
# cookbook 'omnibus', github: 'opscode-cookbooks/omnibus'
group :integration do
cookbook 'apt', '~> 2.3'
cookbook 'freebsd', '~> 0.1'
cookbook 'yum-epel', '~> 0.3'
end
source 'https://rubygems.org'
# Install omnibus
gem 'omnibus', '~> 4.0'
# Use Chef's software definitions. It is recommended that you write your own
# software definitions, but you can clone/fork Chef's to get you started.
# gem 'omnibus-software', github: 'opscode/omnibus-software'
# This development group is installed by default when you run `bundle install`,
# but if you are using Omnibus in a CI-based infrastructure, you do not need
# the Test Kitchen-based build lab. You can skip these unnecessary dependencies
# by running `bundle install --without development` to speed up build times.
group :development do
# Use Berkshelf for resolving cookbook dependencies
gem 'berkshelf', '~> 3.0'
# Use Test Kitchen with Vagrant for converging the build environment
gem 'test-kitchen', '~> 1.2'
gem 'kitchen-vagrant', '~> 0.14'
end
gitlab-runner Omnibus project
=============================
This project creates full-stack platform-specific packages for
`gitlab-runner`!
Installation
------------
You must have a sane Ruby 1.9+ environment with Bundler installed. Ensure all
the required gems are installed:
```shell
$ bundle install --binstubs
```
Usage
-----
### Build
You create a platform-specific package using the `build project` command:
```shell
$ bin/omnibus build gitlab-runner
```
The platform/architecture type of the package created will match the platform
where the `build project` command is invoked. For example, running this command
on a MacBook Pro will generate a Mac OS X package. After the build completes
packages will be available in the `pkg/` folder.
### Clean
You can clean up all temporary files generated during the build process with
the `clean` command:
```shell
$ bin/omnibus clean gitlab-runner
```
Adding the `--purge` purge option removes __ALL__ files generated during the
build including the project install directory (`/opt/gitlab-runner`) and
the package cache directory (`/var/cache/omnibus/pkg`):
```shell
$ bin/omnibus clean gitlab-runner --purge
```
### Publish
Omnibus has a built-in mechanism for releasing to a variety of "backends", such
as Amazon S3. You must set the proper credentials in your `omnibus.rb` config
file or specify them via the command line.
```shell
$ bin/omnibus publish path/to/*.deb --backend s3
```
### Help
Full help for the Omnibus command line interface can be accessed with the
`help` command:
```shell
$ bin/omnibus help
```
Kitchen-based Build Environment
-------------------------------
Every Omnibus project ships will a project-specific
[Berksfile](http://berkshelf.com/) that will allow you to build your omnibus projects on all of the projects listed
in the `.kitchen.yml`. You can add/remove additional platforms as needed by
changing the list found in the `.kitchen.yml` `platforms` YAML stanza.
This build environment is designed to get you up-and-running quickly. However,
there is nothing that restricts you to building on other platforms. Simply use
the [omnibus cookbook](https://github.com/opscode-cookbooks/omnibus) to setup
your desired platform and execute the build steps listed above.
The default build environment requires Test Kitchen and VirtualBox for local
development. Test Kitchen also exposes the ability to provision instances using
various cloud providers like AWS, DigitalOcean, or OpenStack. For more
information, please see the [Test Kitchen documentation](http://kitchen.ci).
Once you have tweaked your `.kitchen.yml` (or `.kitchen.local.yml`) to your
liking, you can bring up an individual build environment using the `kitchen`
command.
```shell
$ bin/kitchen converge ubuntu-1204
```
Then login to the instance and build the project as described in the Usage
section:
```shell
$ bundle exec kitchen login ubuntu-1204
[vagrant@ubuntu...] $ cd gitlab-runner
[vagrant@ubuntu...] $ bundle install
[vagrant@ubuntu...] $ ...
[vagrant@ubuntu...] $ bin/omnibus build gitlab-runner
```
For a complete list of all commands and platforms, run `kitchen list` or
`kitchen help`.
#
# Copyright 2015 YOUR NAME
#
# All Rights Reserved.
#
name "gitlab-runner"
maintainer "CHANGE ME"
homepage "https://CHANGE-ME.com"
# Defaults to C:/gitlab-runner on Windows
# and /opt/gitlab-runner on all other platforms
install_dir "#{default_root}/#{name}"
build_version Omnibus::BuildVersion.semver
build_iteration 1
# Creates required build directories
dependency "preparation"
# gitlab-runner dependencies/components
# dependency "somedep"
# Version manifest file
dependency "version-manifest"
exclude "**/.git"
exclude "**/bundler/git"
#
# Copyright 2015 YOUR NAME
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# These options are required for all software definitions
name "gitlab-runner-zlib"
default_version "1.2.6"
# A software can specify more than one version that is available for install
version("1.2.6") { source md5: "618e944d7c7cd6521551e30b32322f4a" }
version("1.2.8") { source md5: "44d667c142d7cda120332623eab69f40" }
# Sources may be URLs, git locations, or path locations
source url: "http://downloads.sourceforge.net/project/libpng/zlib/#{version}/zlib-#{version}.tar.gz"
# This is the path, inside the tarball, where the source resides
relative_path "zlib-#{version}"
build do
# Setup a default environment from Omnibus - you should use this Omnibus
# helper everywhere. It will become the default in the future.
env = with_standard_compiler_flags(with_embedded_path)
# Manipulate any configure flags you wish:
# For some reason zlib needs this flag on solaris
env["CFLAGS"] << " -DNO_VIZ" if solaris?
# "command" is part of the build DSL. There are a number of handy options
# available, such as "copy", "sync", "ruby", etc. For a complete list, please
# consult the Omnibus gem documentation.
#
# "install_dir" is exposed and refers to the top-level projects +install_dir+
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
# You can have multiple steps - they are executed in the order in which they
# are read.
#
# "workers" is a DSL method that returns the most suitable number of
# builders for the currently running system.
command "make -j #{workers}", env: env
command "make -j #{workers} install", env: env
end
#
# This file is used to configure the gitlab-runner project. It contains
# some minimal configuration examples for working with Omnibus. For a full list
# of configurable options, please see the documentation for +omnibus/config.rb+.
#
# Build internally
# ------------------------------
# By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and
# cache components. If you would to build everything internally, you can
# uncomment the following options. This will prevent the need for root
# permissions in most cases.
#
# Uncomment this line to change the default base directory to "local"
# -------------------------------------------------------------------
# base_dir './local'
#
# Alternatively you can tune the individual values
# ------------------------------------------------
# cache_dir './local/omnibus/cache'
# git_cache_dir './local/omnibus/cache/git_cache'
# source_dir './local/omnibus/src'
# build_dir './local/omnibus/build'
# package_dir './local/omnibus/pkg'
# package_tmp './local/omnibus/pkg-tmp'
# Disable git caching
# ------------------------------
# use_git_caching false
# Enable S3 asset caching
# ------------------------------
# use_s3_caching true
# s3_access_key ENV['AWS_ACCESS_KEY_ID']
# s3_secret_key ENV['AWS_SECRET_ACCESS_KEY']
# s3_bucket ENV['AWS_S3_BUCKET']
# Customize compiler bits
# ------------------------------
# solaris_compiler 'gcc'
# build_retries 5
# fetcher_read_timeout 120
# Load additional software
# ------------------------------
# software_gems ['omnibus-software', 'my-company-software']
# local_software_dirs ['/path/to/local/software']
#!/bin/bash
#
# Perform necessary gitlab-runner setup steps
# after package is installed.
#
PROGNAME=$(basename $0)
function error_exit
{
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
exit 1
}
echo "Thank you for installing gitlab-runner!"
exit 0
#!/bin/bash
#
# Perform necessary gitlab-runner removal steps
# after package is uninstalled.
#
echo "gitlab-runner has been uninstalled!"
exit 0
#!/bin/bash
#
# Perform necessary gitlab-runner setup steps
# before package is installed.
#
echo "You're about to install gitlab-runner!"
#!/bin/bash
#
# Perform necessary gitlab-runner setup steps
# prior to installing package.
#
PROGNAME=$(basename $0)
function error_exit
{
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
exit 1
}
exit 0
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