Skip to content

Commit f0189c7

Browse files
author
Cameron Johnston
committed
add custom dockerfiles and update travis config for asset build
1 parent c463ac7 commit f0189c7

File tree

8 files changed

+119
-1
lines changed

8 files changed

+119
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ script:
2525
- gem build sensu-plugins-postgres.gemspec
2626
- gem install sensu-plugins-postgres-*.gem
2727
before_deploy:
28-
- bash -c "[ ! -d bonsai/ ] && git clone https://github.com/sensu/sensu-go-bonsai-asset.git --branch postgres --single-branch bonsai || echo 'bonsai/ exists, skipping git clone'"
28+
- bash -c "[ ! -d bonsai/ ] && git clone https://github.com/sensu/sensu-go-bonsai-asset.git bonsai || echo 'bonsai/ exists, skipping git clone' ; cp asset_build_scripts/Dockerfile.* bonsai/ruby-runtime/"
2929
deploy:
3030
- provider: rubygems
3131
api_key:

asset_build_scripts/Dockerfile.alpine

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-alpine:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN apk add git
7+
RUN apk add postgresql-client postgresql-dev
8+
RUN \
9+
gem install --no-ri --no-doc bundler && \
10+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
12+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13+
14+
FROM scratch
15+
ARG ASSET_GEM
16+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-alpine3.8:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN apk add git
7+
RUN apk add postgresql-client postgresql-dev
8+
RUN \
9+
gem install --no-ri --no-doc bundler && \
10+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
12+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13+
14+
FROM scratch
15+
ARG ASSET_GEM
16+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /

asset_build_scripts/Dockerfile.centos

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-centos:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN yum install -y git
7+
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
8+
RUN yum install -y postgresql95 postgresql95-libs postgresql95-devel
9+
ENV CONFIGURE_ARGS="with-pg-config=/usr/pgsql-9.5/bin/pg_config"
10+
RUN \
11+
gem install --no-ri --no-doc bundler && \
12+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
14+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15+
16+
FROM scratch
17+
ARG ASSET_GEM
18+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-centos6:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN yum install -y git
7+
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
8+
RUN yum install -y postgresql95 postgresql95-libs postgresql95-devel
9+
ENV CONFIGURE_ARGS="with-pg-config=/usr/pgsql-9.5/bin/pg_config"
10+
RUN \
11+
gem install --no-ri --no-doc bundler && \
12+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
14+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15+
16+
FROM scratch
17+
ARG ASSET_GEM
18+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-centos7:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN yum install -y git
7+
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
8+
RUN yum install -y postgresql95 postgresql95-libs postgresql95-devel
9+
ENV CONFIGURE_ARGS="with-pg-config=/usr/pgsql-9.5/bin/pg_config"
10+
RUN \
11+
gem install --no-ri --no-doc bundler && \
12+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
13+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
14+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
15+
16+
FROM scratch
17+
ARG ASSET_GEM
18+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /

asset_build_scripts/Dockerfile.debian

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-debian:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN apt-get update && apt-get install -y git
7+
RUN apt-get install -y libpq-dev
8+
RUN \
9+
gem install --no-ri --no-doc bundler && \
10+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
12+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13+
14+
FROM scratch
15+
ARG ASSET_GEM
16+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM sensu/sensu-ruby-runtime-2.4.4-debian9:latest as builder
2+
ARG ASSET_GEM
3+
ARG GIT_REF
4+
ARG GIT_REPO
5+
WORKDIR /assets/build/
6+
RUN apt-get update && apt-get install -y git
7+
RUN apt-get install -y libpq-dev
8+
RUN \
9+
gem install --no-ri --no-doc bundler && \
10+
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
11+
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
12+
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
13+
14+
FROM scratch
15+
ARG ASSET_GEM
16+
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /

0 commit comments

Comments
 (0)