Skip to content

Commit eea978e

Browse files
author
Todd Campbell
authored
Merge pull request #119 from jspaleta/fix/asset-enablement
Fix/asset enablement
2 parents f0ec16b + 058af8c commit eea978e

File tree

8 files changed

+76
-10
lines changed

8 files changed

+76
-10
lines changed

.bonsai.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
22
description: "#{repo}"
33
builds:
4-
- platform: "debian"
4+
- platform: "alpine"
55
arch: "amd64"
6-
asset_filename: "#{repo}_#{version}_debian_linux_amd64.tar.gz"
6+
asset_filename: "#{repo}_#{version}_alpine_linux_amd64.tar.gz"
77
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
88
filter:
99
- "entity.system.os == 'linux'"
1010
- "entity.system.arch == 'amd64'"
11-
- "entity.system.platform_family == 'debian'"
12-
- platform: "centos"
11+
- "entity.system.platform == 'alpine'"
12+
- "entity.system.platform_version.split('.')[0] == '3'"
13+
- platform: "alpine3.8"
1314
arch: "amd64"
14-
asset_filename: "#{repo}_#{version}_centos_linux_amd64.tar.gz"
15+
asset_filename: "#{repo}_#{version}_alpine3.8_linux_amd64.tar.gz"
1516
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
1617
filter:
1718
- "entity.system.os == 'linux'"
1819
- "entity.system.arch == 'amd64'"
19-
- "entity.system.platform_family == 'rhel'"
20+
- "entity.system.platform == 'alpine'"
2021
- platform: "centos6"
2122
arch: "amd64"
2223
asset_filename: "#{repo}_#{version}_centos6_linux_amd64.tar.gz"
@@ -25,7 +26,7 @@ builds:
2526
- "entity.system.os == 'linux'"
2627
- "entity.system.arch == 'amd64'"
2728
- "entity.system.platform_family == 'rhel'"
28-
- "parseInt(entity.system.platform_version.split('.')[0]) > 6"
29+
- "entity.system.platform_version.split('.')[0] == '6'"
2930
- platform: "centos7"
3031
arch: "amd64"
3132
asset_filename: "#{repo}_#{version}_centos7_linux_amd64.tar.gz"
@@ -34,4 +35,19 @@ builds:
3435
- "entity.system.os == 'linux'"
3536
- "entity.system.arch == 'amd64'"
3637
- "entity.system.platform_family == 'rhel'"
37-
- "parseInt(entity.system.platform_version.split('.')[0]) > 7"
38+
- "entity.system.platform_version.split('.')[0] == '7'"
39+
- platform: "debian"
40+
arch: "amd64"
41+
asset_filename: "#{repo}_#{version}_debian_linux_amd64.tar.gz"
42+
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
43+
filter:
44+
- "entity.system.os == 'linux'"
45+
- "entity.system.arch == 'amd64'"
46+
- "entity.system.platform_family == 'debian'"
47+
- platform: "debian9"
48+
arch: "amd64"
49+
asset_filename: "#{repo}_#{version}_debian9_linux_amd64.tar.gz"
50+
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
51+
filter:
52+
- "entity.system.os == 'linux'"
53+
- "entity.system.arch == 'amd64'"

asset_build_scripts/Dockerfile.alpine

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ FROM sensu/sensu-ruby-runtime-2.4.4-alpine:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
ARG RUBY_VERSION=2.4.4
6+
57
WORKDIR /assets/build/
8+
RUN apk del openssl-dev
69
RUN apk add git
7-
RUN apk add postgresql-client postgresql-dev
10+
RUN apk add libressl-dev postgresql-client postgresql-dev
811
RUN \
912
gem install --no-ri --no-doc bundler && \
1013
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1114
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15+
16+
RUN LIBS=$(find ./ -type f -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
17+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
18+
19+
1220
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1321

1422
FROM scratch

asset_build_scripts/Dockerfile.alpine3.8

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ FROM sensu/sensu-ruby-runtime-2.4.4-alpine3.8:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
ARG RUBY_VERSION=2.4.4
6+
57
WORKDIR /assets/build/
8+
RUN apk del openssl-dev
69
RUN apk add git
7-
RUN apk add postgresql-client postgresql-dev
10+
RUN apk add libressl-dev postgresql-client postgresql-dev
811
RUN \
912
gem install --no-ri --no-doc bundler && \
1013
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1114
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15+
16+
RUN LIBS=$(find ./ -type f -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
17+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
18+
1219
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1320

1421
FROM scratch

asset_build_scripts/Dockerfile.centos

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ FROM sensu/sensu-ruby-runtime-2.4.4-centos:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
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)'
6+
ARG RUBY_VERSION=2.4.4
7+
58
WORKDIR /assets/build/
69
RUN yum install -y git
710
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
@@ -11,6 +14,10 @@ RUN \
1114
gem install --no-ri --no-doc bundler && \
1215
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1316
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
17+
18+
RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
19+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
20+
1421
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1522

1623
FROM scratch

asset_build_scripts/Dockerfile.centos6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ FROM sensu/sensu-ruby-runtime-2.4.4-centos6:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
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)'
6+
ARG RUBY_VERSION=2.4.4
7+
58
WORKDIR /assets/build/
69
RUN yum install -y git
710
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
@@ -11,6 +14,10 @@ RUN \
1114
gem install --no-ri --no-doc bundler && \
1215
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1316
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
17+
18+
RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
19+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
20+
1421
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1522

1623
FROM scratch

asset_build_scripts/Dockerfile.centos7

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ FROM sensu/sensu-ruby-runtime-2.4.4-centos7:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
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)'
6+
ARG RUBY_VERSION=2.4.4
7+
58
WORKDIR /assets/build/
69
RUN yum install -y git
710
RUN yum install -y http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
@@ -11,6 +14,10 @@ RUN \
1114
gem install --no-ri --no-doc bundler && \
1215
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1316
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
17+
18+
RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
19+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
20+
1421
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1522

1623
FROM scratch

asset_build_scripts/Dockerfile.debian

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ FROM sensu/sensu-ruby-runtime-2.4.4-debian:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
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)'
6+
ARG RUBY_VERSION=2.4.4
7+
58
WORKDIR /assets/build/
69
RUN apt-get update && apt-get install -y git
710
RUN apt-get install -y libpq-dev
811
RUN \
912
gem install --no-ri --no-doc bundler && \
1013
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1114
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15+
16+
RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
17+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
18+
1219
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1320

1421
FROM scratch

asset_build_scripts/Dockerfile.debian9

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ FROM sensu/sensu-ruby-runtime-2.4.4-debian9:latest as builder
22
ARG ASSET_GEM
33
ARG GIT_REF
44
ARG GIT_REPO
5+
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)'
6+
ARG RUBY_VERSION=2.4.4
7+
58
WORKDIR /assets/build/
69
RUN apt-get update && apt-get install -y git
710
RUN apt-get install -y libpq-dev
811
RUN \
912
gem install --no-ri --no-doc bundler && \
1013
printf "source 'https://rubygems.org'\n\ngem \"%s\", :git => \"%s\" , :ref => \"%s\"\n" ${ASSET_GEM} ${GIT_REPO} ${GIT_REF}| tee Gemfile
1114
RUN bundle install --path=lib/ --binstubs=bin/ --standalone
15+
16+
RUN LIBS=$(find ./ -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
17+
for f in $LIBS; do if [ -e $f ] && [ ! -e /opt/rubies/ruby-${RUBY_VERSION}/lib/$f ] ; then echo "Copying Library: $f" && cp $f ./lib/; fi; done
18+
1219
RUN tar -czf /assets/${ASSET_GEM}.tar.gz -C /assets/build/ .
1320

1421
FROM scratch

0 commit comments

Comments
 (0)