Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ builds:
- "entity.system.arch == 'amd64'"
- "entity.system.platform == 'alpine'"
- "entity.system.platform_version.split('.')[0] == '3'"
- platform: "alpine3.8"
- platform: "debian"
arch: "amd64"
asset_filename: "#{repo}_#{version}_alpine3.8_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_debian_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform == 'alpine'"
- "entity.system.platform_family == 'debian'"
- platform: "centos6"
arch: "amd64"
asset_filename: "#{repo}_#{version}_centos6_linux_amd64.tar.gz"
Expand All @@ -26,7 +26,7 @@ builds:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'rhel'"
- "entity.system.platform_version.split('.')[0] == '6'"
- "parseInt(entity.system.platform_version.split('.')[0]) == 6"
- platform: "centos7"
arch: "amd64"
asset_filename: "#{repo}_#{version}_centos7_linux_amd64.tar.gz"
Expand All @@ -35,19 +35,13 @@ builds:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'rhel'"
- "entity.system.platform_version.split('.')[0] == '7'"
- platform: "debian"
- "parseInt(entity.system.platform_version.split('.')[0]) == 7"
- platform: "centos8"
arch: "amd64"
asset_filename: "#{repo}_#{version}_debian_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'debian'"
- platform: "debian9"
arch: "amd64"
asset_filename: "#{repo}_#{version}_debian9_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_centos8_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'rhel'"
- "parseInt(entity.system.platform_version.split('.')[0]) == 8"
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ script:
- gem build sensu-plugins-network-checks.gemspec
- gem install sensu-plugins-network-checks-*.gem
before_deploy:
- bash -c "[ ! -d bonsai/ ] && git clone https://github.com/sensu/sensu-go-bonsai-asset.git bonsai || echo 'bonsai/ exists, skipping git clone'"
- 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/"
deploy:
- provider: rubygems
api_key:
Expand All @@ -34,7 +34,7 @@ deploy:
rvm: 2.4.1
repo: sensu-plugins/sensu-plugins-network-checks
- provider: script
script: bonsai/ruby-runtime/travis-build-ruby-plugin-assets.sh sensu-plugins-network-checks
script: bonsai/ruby-runtime/travis-build-ruby-plugin-assets.sh sensu-plugins-network-checks alpine,debian,centos6,centos7,centos8
skip_cleanup: true
on:
tags: true
Expand Down
21 changes: 21 additions & 0 deletions asset_build_scripts/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM sensu/sensu-ruby-runtime-2.4.4-alpine:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO

WORKDIR /assets/build/
RUN apk add git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/sbin/mtr /assets/build/bin/
RUN LIBS=$(ldd /assets/build/bin/mtr 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | grep -v "ldd" | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
20 changes: 20 additions & 0 deletions asset_build_scripts/Dockerfile.alpine3.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM sensu/sensu-ruby-runtime-2.4.4-alpine3.8:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
WORKDIR /assets/build/
RUN apk add git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/sbin/mtr /assets/build/bin/
RUN LIBS=$(ldd /assets/build/bin/mtr 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | grep -v "ldd" | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
23 changes: 23 additions & 0 deletions asset_build_scripts/Dockerfile.centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM sensu/sensu-ruby-runtime-2.4.4-centos:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

WORKDIR /assets/build/
RUN yum install -y git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/sbin/mtr /assets/build/bin/

RUN LIBS=$(find /assets/build/bin -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
23 changes: 23 additions & 0 deletions asset_build_scripts/Dockerfile.centos6
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM sensu/sensu-ruby-runtime-2.4.4-centos6:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

WORKDIR /assets/build/
RUN yum install -y git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/sbin/mtr /assets/build/bin/

RUN LIBS=$(find /assets/build/bin -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
23 changes: 23 additions & 0 deletions asset_build_scripts/Dockerfile.centos7
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM sensu/sensu-ruby-runtime-2.4.4-centos7:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

WORKDIR /assets/build/
RUN yum install -y git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/sbin/mtr /assets/build/bin/

RUN LIBS=$(find /assets/build/bin -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
23 changes: 23 additions & 0 deletions asset_build_scripts/Dockerfile.centos8
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM sensu/sensu-ruby-runtime-2.4.4-centos8:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

WORKDIR /assets/build/
RUN yum install -y git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/sbin/mtr /assets/build/bin/

RUN LIBS=$(find /assets/build/bin -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
26 changes: 26 additions & 0 deletions asset_build_scripts/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM sensu/sensu-ruby-runtime-2.4.4-debian:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

WORKDIR /assets/build/
RUN apt-get update && apt-get install -y git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/bin/mtr /assets/build/bin/

RUN LIBS=$(find /assets/build/bin -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

#RUN LIBS=$(ldd /assets/build/bin/mtr 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | grep -v "ldd" | awk '{print $3}'| sort -u ) && \
# for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /
23 changes: 23 additions & 0 deletions asset_build_scripts/Dockerfile.debian9
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM sensu/sensu-ruby-runtime-2.4.4-debian9:latest as builder
ARG ASSET_GEM
ARG GIT_REF
ARG GIT_REPO
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

WORKDIR /assets/build/
RUN apt-get update && apt-get install -y git mtr
RUN \
gem install --no-ri --no-doc bundler && \
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
RUN bundle install --path=lib/ --binstubs=bin/ --standalone

RUN cp /usr/bin/mtr /assets/build/bin/

RUN LIBS=$(find /assets/build/bin -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /assets/build/lib/; fi; done

RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .

FROM scratch
ARG ASSET_GEM
COPY --from=builder /assets/${ASSET_GEM}.tar.gz /