Skip to content

Commit

Permalink
merging with current master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jef Spaleta committed Dec 12, 2019
2 parents 8d83ae5 + 2bf84b2 commit 665c751
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 11 deletions.
19 changes: 15 additions & 4 deletions .bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,24 @@ builds:
- "entity.system.platform == 'amazon'"
- "entity.system.arch == 'amd64'"

- platform: "centos"
- platform: "centos6"
arch: "amd64"
asset_filename: "monitoring-plugins-centos_#{version}_linux_amd64.tar.gz"
asset_filename: "monitoring-plugins-centos6_#{version}_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.platform == 'centos'"
- "entity.system.platform_family == 'rhel'"
- "entity.system.platform_version.split('.')[0] == '6'"
- "entity.system.arch == 'amd64'"

- platform: "centos7"
arch: "amd64"
asset_filename: "monitoring-plugins-centos7_#{version}_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.platform_family == 'rhel'"
- "entity.system.platform_version.split('.')[0] == '7'"
- "entity.system.arch == 'amd64'"

- platform: "debian"
Expand All @@ -34,5 +45,5 @@ builds:
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.platform == 'debian'"
- "entity.system.platform_family == 'debian'"
- "entity.system.arch == 'amd64'"
12 changes: 12 additions & 0 deletions Dockerfile.centos6
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM centos:6 as builder

ARG SENSU_GO_ASSET_NAME="monitoring-plugins-centos6"
ARG SENSU_GO_ASSET_VERSION="2.2.0"
ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib64/nagios/plugins/

RUN yum install -y epel-release which && yum install -y nagios-plugins-all
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
2 changes: 1 addition & 1 deletion Dockerfile.centos → Dockerfile.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7 as builder

ARG SENSU_GO_ASSET_NAME="monitoring-plugins-centos"
ARG SENSU_GO_ASSET_NAME="monitoring-plugins-centos7"
ARG SENSU_GO_ASSET_VERSION="2.2.0"
ARG PLUGINS="check_http"

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ creating a Sensu Go Asset containing the C plugins.

## Goal

The goal of this project is to provide Sensu Go Assets for CentOS Linux, Debian
The goal of this project is to provide Sensu Go Assets for CentOS Linux (6 and 7), Debian
Linux, and Alpine Linux containing all of the plugins from the Monitoring
Plugins project.

Expand Down Expand Up @@ -48,8 +48,8 @@ In no particular order:
1. Clone this repo:

~~~
$ git clone git@github.com:calebhailey/sensu-assets-monitoring-plugins.git
$ cd sensu-assets-monitoring-plugins
$ git clone git@github.com:sensu/monitoring-plugins.git
$ cd monitoring-plugins
~~~

2. Build the Docker containers and extract the Sensu assets:
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export PLUGINS="check_disk,check_http,check_ntp,check_ntp_peer,check_ntp_time,ch
export SENSU_GO_ASSET_VERSION=$(git describe --abbrev=0 --tags)

mkdir assets/
for PLATFORM in alpine amazon centos debian;
for PLATFORM in alpine amazon debian centos6 centos7;
do
export SENSU_GO_ASSET_FILENAME="monitoring-plugins-${PLATFORM}_${SENSU_GO_ASSET_VERSION}_linux_amd64.tar.gz"
docker build --build-arg "PLUGINS=$PLUGINS" --build-arg "SENSU_GO_ASSET_VERSION=$SENSU_GO_ASSET_VERSION" -t monitoring-plugins-${PLATFORM}:$SENSU_GO_ASSET_VERSION -f Dockerfile.${PLATFORM} .
docker cp -L $(docker create monitoring-plugins-${PLATFORM}:$SENSU_GO_ASSET_VERSION true):/$SENSU_GO_ASSET_FILENAME ./assets/
docker build --no-cache --rm --build-arg "PLUGINS=$PLUGINS" --build-arg "SENSU_GO_ASSET_VERSION=$SENSU_GO_ASSET_VERSION" -t monitoring-plugins-${PLATFORM}:$SENSU_GO_ASSET_VERSION -f Dockerfile.${PLATFORM} .
docker cp -L $(docker create --rm monitoring-plugins-${PLATFORM}:$SENSU_GO_ASSET_VERSION true):/$SENSU_GO_ASSET_FILENAME ./assets/
done;

cd assets/
Expand Down

0 comments on commit 665c751

Please sign in to comment.