Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Commit

Permalink
Set up docker build for cent 7 package
Browse files Browse the repository at this point in the history
  • Loading branch information
benLogN committed Nov 16, 2015
1 parent 6c0eb1f commit 9543af5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ Bunchr::Packages.new do |t|
t.maintainer = 'Sensu Helpdesk <helpdesk@sensuapp.com>'

platform_family = t.ohai.platform_family
platform_version = t.ohai.platform_version

init_strategy = \
if platform_family == 'rhel' && ( t.iteration.match(/el7$/) )
if platform_family == 'rhel' && \
(Gem::Version.new(platform_version) >= Gem::Version.new('7'))
t.iteration = "#{ENV['BUILD_NUMBER']}.el7"
'systemd'
else
'init.d'
Expand Down
2 changes: 2 additions & 0 deletions docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ docker build -f dockerfiles/debian-i386 -t sensu-build-debian-i386 .
docker build -f dockerfiles/debian-amd64 -t sensu-build-debian-amd64 .
docker build -f dockerfiles/centos-i386 -t sensu-build-centos-i386 .
docker build -f dockerfiles/centos-x86_64 -t sensu-build-centos-x86_64 .
docker build -f dockerfiles/centos7-x86_64 -t sensu-build-centos7-x86_64 .

env="-e SENSU_VERSION=${SENSU_VERSION-0.20.6} -e BUILD_NUMBER=${BUILD_NUMBER-1}"
vol="-v ${1-/tmp/assets}:/tmp/assets"
Expand All @@ -19,3 +20,4 @@ docker run --rm $env $vol sensu-build-debian-i386 $run
docker run --rm $env $vol sensu-build-debian-amd64 $run
docker run --rm $env $vol sensu-build-centos-i386 $run
docker run --rm $env $vol sensu-build-centos-x86_64 $run
docker run --rm $env $vol sensu-build-centos7-x86_64 $run
22 changes: 22 additions & 0 deletions dockerfiles/centos7-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM centos:centos7

RUN yum clean all

RUN yum install -y epel-release

RUN yum clean all

RUN yum install -y curl m4 make gcc gcc-c++ rpm-build zlib-devel openssl-devel libyaml-devel autoconf

RUN mkdir -p /usr/src/ruby \
&& curl -L http://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2 | tar -xjC /usr/src/ruby --strip-components=1 \
&& cd /usr/src/ruby \
&& autoconf \
&& ./configure \
&& make \
&& make install \
&& rm -r /usr/src/ruby

RUN gem install bundler

ADD archive.tar /sensu-build
2 changes: 2 additions & 0 deletions recipes/sensu_init.rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Bunchr::Software.new do |t|
t.name = 'sensu_init'

t.work_dir = Dir.pwd

t.install_commands << "cp -f ./sensu_configs/init.d/* /etc/init.d/"

CLEAN << "/etc/init.d/sensu-*"
Expand Down

0 comments on commit 9543af5

Please sign in to comment.