From 2684cfb4d4747694461468fe4011bb42def40afe Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 17:10:54 -0400 Subject: [PATCH 01/43] add circleci --- .circleci/config.yml | 23 +++++++++ .idea/workspace.xml | 120 ++++++++++++++++++++++--------------------- LICENSE-2.0 | 13 +++++ 3 files changed, 97 insertions(+), 59 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 LICENSE-2.0 diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..f006da0 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,23 @@ + version: 2 + jobs: + build: + environment: + IMAGE_NAME: rfaircloth/scs + docker: + - image: circleci/buildpack-deps:stretch + steps: + - checkout + - setup_remote_docker + - run: + name: Build Docker image + command: docker build -t $IMAGE_NAME:latest . + workflows: + version: 2 + build-publish: + jobs: + - build: + filters: + branches: + only: + - master + - develop \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5f6de25..503b46d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,8 @@ + - @@ -297,7 +275,7 @@ - @@ -312,13 +290,12 @@ - + - - + @@ -327,8 +304,9 @@ - + + @@ -390,13 +368,6 @@ - - - - - - - @@ -487,20 +458,33 @@ - + - - + + - + - - + + + + + + + + + + + + + + + @@ -508,13 +492,31 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LICENSE-2.0 b/LICENSE-2.0 new file mode 100644 index 0000000..913f595 --- /dev/null +++ b/LICENSE-2.0 @@ -0,0 +1,13 @@ +Copyright 2019 Splunk Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file From 97f5fe65cacc39dfff2b59fdcf12b17c984b894d Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 17:14:40 -0400 Subject: [PATCH 02/43] add context flag --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f006da0..a781447 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ - setup_remote_docker - run: name: Build Docker image - command: docker build -t $IMAGE_NAME:latest . + command: docker build -f package/Dockerfile -t $IMAGE_NAME:latest . workflows: version: 2 build-publish: From 02ba6b998e8b49419503a205d7261d414aa76945 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 17:18:27 -0400 Subject: [PATCH 03/43] build in sub directory --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a781447..a6acbe9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ - setup_remote_docker - run: name: Build Docker image - command: docker build -f package/Dockerfile -t $IMAGE_NAME:latest . + command: pushd package; docker build -f package/Dockerfile -t $IMAGE_NAME:latest . workflows: version: 2 build-publish: From fdae629835a399ccdec37f3f7f6f1b93bb4afb9a Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 17:20:13 -0400 Subject: [PATCH 04/43] build in sub directory --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6acbe9..cafbb3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ - setup_remote_docker - run: name: Build Docker image - command: pushd package; docker build -f package/Dockerfile -t $IMAGE_NAME:latest . + command: pushd package; docker build -f Dockerfile -t $IMAGE_NAME:latest . workflows: version: 2 build-publish: From 529e7797615e30ca4bd40747c0fc8441d18e757b Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 17:29:51 -0400 Subject: [PATCH 05/43] add submodule config --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cafbb3b..a3bd4a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,10 +7,14 @@ - image: circleci/buildpack-deps:stretch steps: - checkout + - run: git submodule sync + - run: git submodule update --init - setup_remote_docker + docker_layer_caching: true # default - false - run: name: Build Docker image - command: pushd package; docker build -f Dockerfile -t $IMAGE_NAME:latest . + command: pushd package; docker build -f Dockerfile -t $IMAGE_NAME:build . + workflows: version: 2 build-publish: From 90d30b86a6ecdf883283a8c9c1a140be2f548254 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 17:34:31 -0400 Subject: [PATCH 06/43] add submodule config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3bd4a3..eecf47f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,8 +9,8 @@ - checkout - run: git submodule sync - run: git submodule update --init - - setup_remote_docker - docker_layer_caching: true # default - false + - setup_remote_docker: + docker_layer_caching: true - run: name: Build Docker image command: pushd package; docker build -f Dockerfile -t $IMAGE_NAME:build . From 8817488f312c536b90c143f8a8306854662ec75d Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 18:43:11 -0400 Subject: [PATCH 07/43] submodules need recursive --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eecf47f..d11764e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ steps: - checkout - run: git submodule sync - - run: git submodule update --init + - run: git submodule update --init --recursive - setup_remote_docker: docker_layer_caching: true - run: From befb63fe587f8bff63e166adceaef3e557a16d2a Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:12:17 -0400 Subject: [PATCH 08/43] missing scripts --- package/scripts/splunkmetrics.sh | 30 +++++++++++++++++++++++++++ package/scripts/switch_transport.sh | 32 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100755 package/scripts/splunkmetrics.sh create mode 100755 package/scripts/switch_transport.sh diff --git a/package/scripts/splunkmetrics.sh b/package/scripts/splunkmetrics.sh new file mode 100755 index 0000000..d62014d --- /dev/null +++ b/package/scripts/splunkmetrics.sh @@ -0,0 +1,30 @@ +#!/bin/bash +sleep 30 +while sleep 10 +do + TS=$(date +"%s") + tmpfilecsv=$(mktemp /tmp/syslog-ng-stats-XXXXXXX-csv) + tmpfilejson=$(mktemp /tmp/syslog-ng-stats-XXXXXXX-json) + /opt/syslog-ng/sbin/syslog-ng-ctl query get "*" --reset | tail -n +2 | grep \^. | grep -v "^The selected counters" >$tmpfilecsv + IFS=';' + while read -r SourceName SourceId SourceInstance State Type Number + do + echo "{ + \"time\":\"$TS.000\", + \"event\":\"metric\", + \"source\":\"syslog-ng\", + \"host\":\"$HOSTNAME\", + \"index\":\"$SPLUNK_METRICS_INDEX\", + \"fields\":{ + \"SourceId\":\"$SourceId\", + \"SourceInstance\":\"$SourceInstance\", + \"State\":\"$State\", + \"Type\":\"$Type\", + \"_value\":$Number, + \"metric_name\":\"$SourceName\" + } + } ">>$tmpfilejson + done < $tmpfilecsv + + curl -s -S -k $SPLUNK_HEC_STATSURL -H "Authorization: Splunk $SPLUNK_HEC_TOKEN" -d "@$tmpfilejson" +done diff --git a/package/scripts/switch_transport.sh b/package/scripts/switch_transport.sh new file mode 100755 index 0000000..15863c3 --- /dev/null +++ b/package/scripts/switch_transport.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Script to change all filters to use selected transport (UF, HEC, or kafka). +# If one or more filters uses a transport different from all the others, they will need to be +# managed by hand. Unpredictable results can occur if the script is used and +# individual filters are not checked for correctness. + +case $SPLUNK_CONNECT_METHOD in + hec) + echo "Switching transport method for all filters to HEC" + sed '/^# / {/#--HEC--/ s/^#/ /}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed '/^#/! {/#--KAFKA--/ s/^ /#/}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed '/^#/! {/#--UF--/ s/^ /#/}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed 's~__SPLUNK_HEC_URL__~"'"$SPLUNK_HEC_URL"'"~' -i /opt/syslog-ng/etc/conf.d/splunk.conf + sed 's/__SPLUNK_HEC_TOKEN__/'"$SPLUNK_HEC_TOKEN"'/' -i /opt/syslog-ng/etc/conf.d/splunk.conf + ;; + kafka) + echo "Switching transport method for all filters to Kafka" + sed '/^# / {/#--KAFKA--/ s/^#/ /}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed '/^#/! {/#--HEC--/ s/^ /#/}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed '/^#/! {/#--UF--/ s/^ /#/}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + ;; + UF) + echo "Switching transport method for all filters to filesystem/UF" + sed '/^# / {/#--UF--/ s/^#/ /}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed '/^#/! {/#--HEC--/ s/^ /#/}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + sed '/^#/! {/#--KAFKA--/ s/^ /#/}' -i /opt/syslog-ng/etc/conf.d/filters/*.conf; + ;; + *) + echo "Usage: $0 hec|kafka|UF" + ;; +esac From 03ef1c7e6259fbfea5709c1d9f07b73388c5d888 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:23:23 -0400 Subject: [PATCH 09/43] tag and push --- .circleci/config.yml | 9 ++++ .idea/workspace.xml | 116 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 104 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d11764e..e898612 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,9 +11,18 @@ - run: git submodule update --init --recursive - setup_remote_docker: docker_layer_caching: true + - run: + name: Docker Login + command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker image command: pushd package; docker build -f Dockerfile -t $IMAGE_NAME:build . + - run: + name: Tag Docker image + command: docker tag $IMAGE_NAME:build $IMAGE_NAME:$CIRCLE_SHA1 + - run: + name: Push Docker image + command: docker push $IMAGE_NAME:$CIRCLE_SHA1 workflows: version: 2 diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 503b46d..e1fc945 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,7 @@ - + + + + + + + + + + - - + + @@ -52,7 +61,6 @@ - + @@ -275,7 +344,7 @@ - @@ -287,10 +356,10 @@ - + - + @@ -301,10 +370,10 @@ - + - + @@ -323,7 +392,12 @@ - @@ -465,13 +539,6 @@ - - - - - - - @@ -513,10 +580,17 @@ + + + + + + + - - + + From 34d05cd20c02fee7ff15c534fc3d9d760574c809 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:33:59 -0400 Subject: [PATCH 10/43] branch tag --- .circleci/config.yml | 24 ++++++++++++++++++++++-- .idea/workspace.xml | 24 ++++++++++++------------ package/Dockerfile | 5 ++++- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e898612..6604f7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,21 +16,41 @@ command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker image - command: pushd package; docker build -f Dockerfile -t $IMAGE_NAME:build . + command: pushd package; docker build -f Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RG_ACTIVATION=$RG_ACTIVATION -t $IMAGE_NAME:build . - run: name: Tag Docker image command: docker tag $IMAGE_NAME:build $IMAGE_NAME:$CIRCLE_SHA1 - run: name: Push Docker image command: docker push $IMAGE_NAME:$CIRCLE_SHA1 + branchtag: + environment: + IMAGE_NAME: rfaircloth/scs + docker: + - image: circleci/buildpack-deps:stretch + steps: + - setup_remote_docker: + docker_layer_caching: true + - run: + name: Docker Login + command: docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: + name: Tag Docker image + command: docker tag $IMAGE_NAME:$CIRCLE_SHA1 $IMAGE_NAME:$CIRCLE_BRANCH + - run: + name: Push Docker image + command: docker push $IMAGE_NAME:$CIRCLE_BRANCH + + workflows: version: 2 build-publish: jobs: - build: + - branchtag: filters: branches: only: - master - - develop \ No newline at end of file + - develop diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e1fc945..bca3715 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,7 @@ - + - @@ -359,7 +359,7 @@ - + @@ -373,7 +373,7 @@ - + @@ -582,15 +582,15 @@ - - + + - - + + diff --git a/package/Dockerfile b/package/Dockerfile index ae3583c..ba40719 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -1,10 +1,13 @@ FROM registry.access.redhat.com/rhel7/rhel +ARG RH_ORG +ARG RG_ACTIVATION + ENV CONFIGURE_FLAGS="--prefix=/opt/syslog-ng --with-ivykis=system --with-jsonc=system --disable-env-wrapper --disable-memtrace --enable-tcp-wrapper --disable-linux-caps --disable-man-pages --enable-all-modules --enable-force-gnu99 --enable-json --enable-native --enable-python --enable-http --enable-kafka --disable-java --disable-java-modules --disable-spoof_source --disable-sun_streams --disable-sql --disable-pacct --disable-mongodb --disable-amqp --disable-stomp --disable-redis --disable-systemd --disable-geoip --disable-geoip2 --disable-riemann --disable-smtp --disable-snmp_dest --with-python=3 --enable-dynamic-linking" ENV DISTCHECK_CONFIGURE_FLAGS="--prefix=/opt/syslog-ng --with-ivykis=system --with-jsonc=system --disable-env-wrapper --disable-memtrace --enable-tcp-wrapper --disable-linux-caps --disable-man-pages --enable-all-modules --enable-force-gnu99 --enable-json --enable-native --enable-python --enable-http --enable-kafka --disable-java --disable-java-modules --disable-spoof_source --disable-sun_streams --disable-sql --disable-pacct --disable-mongodb --disable-amqp --disable-stomp --disable-redis --disable-systemd --disable-geoip --disable-geoip2 --disable-riemann --disable-smtp --disable-snmp_dest --with-python=3 --enable-dynamic-linking" COPY confluent.repo /etc/yum.repos.d/confluent.repo -RUN subscription-manager register --org=12579482 --activationkey=dev1 --force +RUN subscription-manager register --org=$RH_ORG --activationkey=$RG_ACTIVATION --force RUN subscription-manager repos --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-optional-rpms --enable=rhel-server-rhscl-7-rpms RUN subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" --enable "rhel-ha-for-rhel-*-server-rpms" RUN yum install wget -y From 6966e98c95186cd48da410bffb75114a30c9f814 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:38:36 -0400 Subject: [PATCH 11/43] syntax fix --- .circleci/config.yml | 6 +++--- .idea/workspace.xml | 17 +++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6604f7d..ddc13cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ - run: name: Push Docker image command: docker push $IMAGE_NAME:$CIRCLE_SHA1 - branchtag: + publish: environment: IMAGE_NAME: rfaircloth/scs docker: @@ -47,8 +47,8 @@ version: 2 build-publish: jobs: - - build: - - branchtag: + - build + - publish: filters: branches: only: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bca3715..6f70882 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,6 @@ - - @@ -589,8 +591,11 @@ - - + + + + + From ce1ffcdf8e246e2e4a34cb7175fc01e306f8db39 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:41:49 -0400 Subject: [PATCH 12/43] job control --- .circleci/config.yml | 3 ++- .idea/workspace.xml | 25 ++++++++++--------------- package/Dockerfile | 4 ++-- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ddc13cc..35521ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker image - command: pushd package; docker build -f Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RG_ACTIVATION=$RG_ACTIVATION -t $IMAGE_NAME:build . + command: pushd package; docker build -f Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RH_ACTIVATION=$RHG_ACTIVATION -t $IMAGE_NAME:build . - run: name: Tag Docker image command: docker tag $IMAGE_NAME:build $IMAGE_NAME:$CIRCLE_SHA1 @@ -49,6 +49,7 @@ jobs: - build - publish: + requires: build filters: branches: only: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6f70882..2331fd6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,6 +3,7 @@ + - @@ -584,18 +582,15 @@ - - + + - - - - - + + diff --git a/package/Dockerfile b/package/Dockerfile index ba40719..58019c5 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -1,13 +1,13 @@ FROM registry.access.redhat.com/rhel7/rhel ARG RH_ORG -ARG RG_ACTIVATION +ARG RH_ACTIVATION ENV CONFIGURE_FLAGS="--prefix=/opt/syslog-ng --with-ivykis=system --with-jsonc=system --disable-env-wrapper --disable-memtrace --enable-tcp-wrapper --disable-linux-caps --disable-man-pages --enable-all-modules --enable-force-gnu99 --enable-json --enable-native --enable-python --enable-http --enable-kafka --disable-java --disable-java-modules --disable-spoof_source --disable-sun_streams --disable-sql --disable-pacct --disable-mongodb --disable-amqp --disable-stomp --disable-redis --disable-systemd --disable-geoip --disable-geoip2 --disable-riemann --disable-smtp --disable-snmp_dest --with-python=3 --enable-dynamic-linking" ENV DISTCHECK_CONFIGURE_FLAGS="--prefix=/opt/syslog-ng --with-ivykis=system --with-jsonc=system --disable-env-wrapper --disable-memtrace --enable-tcp-wrapper --disable-linux-caps --disable-man-pages --enable-all-modules --enable-force-gnu99 --enable-json --enable-native --enable-python --enable-http --enable-kafka --disable-java --disable-java-modules --disable-spoof_source --disable-sun_streams --disable-sql --disable-pacct --disable-mongodb --disable-amqp --disable-stomp --disable-redis --disable-systemd --disable-geoip --disable-geoip2 --disable-riemann --disable-smtp --disable-snmp_dest --with-python=3 --enable-dynamic-linking" COPY confluent.repo /etc/yum.repos.d/confluent.repo -RUN subscription-manager register --org=$RH_ORG --activationkey=$RG_ACTIVATION --force +RUN subscription-manager register --org=$RH_ORG --activationkey=$RH_ACTIVATION --force RUN subscription-manager repos --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-optional-rpms --enable=rhel-server-rhscl-7-rpms RUN subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" --enable "rhel-ha-for-rhel-*-server-rpms" RUN yum install wget -y From de463508b7d6015808b65fdbf2bc1c78ed42ac07 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:43:45 -0400 Subject: [PATCH 13/43] job control --- .circleci/config.yml | 3 ++- .idea/workspace.xml | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35521ab..558abd2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,8 @@ jobs: - build - publish: - requires: build + requires: + - build filters: branches: only: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2331fd6..a9e0b64 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,6 @@ - - @@ -589,8 +588,8 @@ - - + + From a02457a04786b914bcf1f6dcb61d32bb34a20672 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 19:45:19 -0400 Subject: [PATCH 14/43] typo --- .circleci/config.yml | 2 +- .idea/workspace.xml | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 558abd2..24cc2b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker image - command: pushd package; docker build -f Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RH_ACTIVATION=$RHG_ACTIVATION -t $IMAGE_NAME:build . + command: pushd package; docker build -f Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RH_ACTIVATION=$RH_ACTIVATION -t $IMAGE_NAME:build . - run: name: Tag Docker image command: docker tag $IMAGE_NAME:build $IMAGE_NAME:$CIRCLE_SHA1 diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a9e0b64..fa8abe7 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,9 +1,7 @@ - - - + - @@ -588,8 +586,8 @@ - - + + From 03899dc3a72dd353e0f8a916144404ccc6da2133 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:16:13 -0400 Subject: [PATCH 15/43] pull before tag --- .circleci/config.yml | 3 +++ .idea/workspace.xml | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 24cc2b3..e6cc3f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,9 @@ - run: name: Docker Login command: docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: + name: Tag Docker pull + command: docker pull $IMAGE_NAME:$CIRCLE_SHA1 - run: name: Tag Docker image command: docker tag $IMAGE_NAME:$CIRCLE_SHA1 $IMAGE_NAME:$CIRCLE_BRANCH diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fa8abe7..20e8e8a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,9 @@ - + + + - @@ -586,8 +588,8 @@ - - + + From e2ad659bca1264c050674fd328c5e3a6bdde2818 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:23:07 -0400 Subject: [PATCH 16/43] add dgoss --- .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++++++---- .idea/workspace.xml | 10 +++++----- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6cc3f6..1ac5687 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,35 @@ - run: name: Push Docker image command: docker push $IMAGE_NAME:$CIRCLE_SHA1 + dgoss: + environment: + IMAGE_NAME: rfaircloth/scs + docker: + - image: circleci/buildpack-deps:stretch + steps: + - setup_remote_docker: + docker_layer_caching: true + - run: + name: Docker Login + command: docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: + name: Docker pull + command: docker pull $IMAGE_NAME:$CIRCLE_SHA1 + - run: + name: Install goss + command: | + # rather than give internet scripts SU rights, we install to local user bin and add to path + curl -fsSL https://goss.rocks/install | sh + - run: + name: Test Docker + command: | + export GOSS_OPTS="--max-concurrent=1 --format junit" + export GOSS_FILES_STRATEGY=cp + mkdir -p /root/test-results + pushd package + dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + popd + cat /tmp/goss.tmp | grep "[<\>]" > /root/test-results/goss.xml publish: environment: IMAGE_NAME: rfaircloth/scs @@ -35,13 +64,13 @@ name: Docker Login command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: - name: Tag Docker pull + name: Docker pull command: docker pull $IMAGE_NAME:$CIRCLE_SHA1 - run: - name: Tag Docker image + name: Docker tag image command: docker tag $IMAGE_NAME:$CIRCLE_SHA1 $IMAGE_NAME:$CIRCLE_BRANCH - run: - name: Push Docker image + name: Docker push tag command: docker push $IMAGE_NAME:$CIRCLE_BRANCH @@ -51,9 +80,12 @@ build-publish: jobs: - build - - publish: + - dgoss: requires: - build + - publish: + requires: + - dgoss filters: branches: only: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 20e8e8a..697d305 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -343,7 +343,7 @@ - @@ -588,8 +588,8 @@ - - + + From d1790577ba9d49e8ce9cdf656c53d8d6b2c355b6 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:25:35 -0400 Subject: [PATCH 17/43] rename goss file --- .idea/workspace.xml | 44 ++++++++++++++++++++++----------- package/Dockerfile | 4 +-- package/{goss.yml => goss.yaml} | 0 3 files changed, 32 insertions(+), 16 deletions(-) rename package/{goss.yml => goss.yaml} (100%) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 697d305..902b460 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,8 @@ - + + - + - - + + - + - + + + + + + @@ -44,6 +50,7 @@ pip yum java + goss.y @@ -68,8 +75,8 @@ @@ -101,6 +108,12 @@ + + + + + + @@ -343,7 +356,7 @@ - @@ -579,17 +592,20 @@ - + - - + + - + + + + - - + + diff --git a/package/Dockerfile b/package/Dockerfile index 58019c5..8846836 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -70,7 +70,7 @@ ENV DEBCONF_NONINTERACTIVE_SEEN=true ENV SPLUNK_CONNECT_METHOD=hec RUN source scl_source enable rh-python36 ; curl -fsSL https://goss.rocks/install | sh -COPY goss.yml /goss/goss.yml +COPY goss.yaml /goss/goss.yaml COPY --from=0 /opt/syslog-ng /opt/syslog-ng COPY scripts/splunkmetrics.sh /opt/syslog-ng/sbin/splunkmetrics.sh @@ -90,4 +90,4 @@ ENV SPLUNK_CONNECT_METHOD=UF ENTRYPOINT ["/sbin/entrypoint.sh", "--"] -HEALTHCHECK --interval=1s --timeout=6s CMD source scl_source enable rh-python36 ;goss -g /goss/goss.yml validate \ No newline at end of file +HEALTHCHECK --interval=1s --timeout=6s CMD source scl_source enable rh-python36 ;goss -g /goss/goss.yaml validate \ No newline at end of file diff --git a/package/goss.yml b/package/goss.yaml similarity index 100% rename from package/goss.yml rename to package/goss.yaml From 3a1738387c6e87ac83aaa5d7027296696606e681 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:31:23 -0400 Subject: [PATCH 18/43] move goss --- .circleci/config.yml | 2 +- .idea/workspace.xml | 33 ++++++++++++++------------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ac5687..eec7476 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,7 @@ name: Install goss command: | # rather than give internet scripts SU rights, we install to local user bin and add to path - curl -fsSL https://goss.rocks/install | sh + curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.6 GOSS_DST=~/bin sh - run: name: Test Docker command: | diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 902b460..e74af74 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,7 @@ - - + - + @@ -22,20 +21,15 @@ - + - - + + - - - - - @@ -51,6 +45,7 @@ yum java goss.y + goss @@ -75,8 +70,8 @@ @@ -356,7 +351,7 @@ - @@ -592,20 +587,20 @@ - + - - + + - + - - + + From ff969c1c90e756c614c3a49754af68113fe09ab9 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:31:49 -0400 Subject: [PATCH 19/43] move goss 2 --- .circleci/config.yml | 2 +- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eec7476..e4c4f3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ export GOSS_FILES_STRATEGY=cp mkdir -p /root/test-results pushd package - dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > /root/test-results/goss.xml publish: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e74af74..43deda3 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From a52dddafd821b05fedde4ddb1d216602e1b6f478 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:42:45 -0400 Subject: [PATCH 20/43] path fix --- .circleci/config.yml | 1 + .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e4c4f3d..e09123a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,6 +41,7 @@ name: Install goss command: | # rather than give internet scripts SU rights, we install to local user bin and add to path + mkdir -p ~/bin curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.6 GOSS_DST=~/bin sh - run: name: Test Docker diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 43deda3..26539f0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From fc578af6518c2bc87ffea5adf08e41aa9fd8091e Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:47:01 -0400 Subject: [PATCH 21/43] test results from goss --- .circleci/config.yml | 6 ++++-- .idea/workspace.xml | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e09123a..428a36a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,11 +48,13 @@ command: | export GOSS_OPTS="--max-concurrent=1 --format junit" export GOSS_FILES_STRATEGY=cp - mkdir -p /root/test-results + mkdir -p test-results pushd package ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd - cat /tmp/goss.tmp | grep "[<\>]" > /root/test-results/goss.xml + cat /tmp/goss.tmp | grep "[<\>]" > test-results/goss.xml + - store_test_results: + path: test-results publish: environment: IMAGE_NAME: rfaircloth/scs diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 26539f0..c381e8a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 02031c51361f1e29f594fc74e6ca7126fc9b5f1c Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:50:13 -0400 Subject: [PATCH 22/43] add chekcout --- .circleci/config.yml | 1 + .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 428a36a..8fc71c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,7 @@ docker: - image: circleci/buildpack-deps:stretch steps: + - checkout - setup_remote_docker: docker_layer_caching: true - run: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c381e8a..c8d59bc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From a24e06bbf2c9169c90604fca8c7eca1f40496b9f Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:52:21 -0400 Subject: [PATCH 23/43] GOSS_PATH set --- .circleci/config.yml | 2 +- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8fc71c9..d1aa30b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ export GOSS_FILES_STRATEGY=cp mkdir -p test-results pushd package - ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + GOSS_PATH=~/bin ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > test-results/goss.xml - store_test_results: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c8d59bc..cce839c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 1e6fc8a7eae3343112f3a73b31d25c67c3d3cccb Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 20:59:54 -0400 Subject: [PATCH 24/43] path work --- .circleci/config.yml | 4 ++-- .idea/workspace.xml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1aa30b..a1901ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,11 +49,11 @@ command: | export GOSS_OPTS="--max-concurrent=1 --format junit" export GOSS_FILES_STRATEGY=cp - mkdir -p test-results + mkdir -p ~/project/test-results pushd package GOSS_PATH=~/bin ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd - cat /tmp/goss.tmp | grep "[<\>]" > test-results/goss.xml + cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: path: test-results publish: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cce839c..d735cae 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From e987a9d5a26a0612d05d6e5833a074abf7adfb3a Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:05:44 -0400 Subject: [PATCH 25/43] test --- .circleci/config.yml | 3 ++- .idea/workspace.xml | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1901ff..b97ec3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,8 @@ export GOSS_FILES_STRATEGY=cp mkdir -p ~/project/test-results pushd package - GOSS_PATH=~/bin ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + GOSS_PATH=~/bin ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d735cae..7eee3da 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -366,7 +366,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -599,8 +599,8 @@ - - + + From 76a3839f786572bafdeab17aa4144f54da05e459 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:11:49 -0400 Subject: [PATCH 26/43] path change --- .circleci/config.yml | 15 ++++++++++----- .idea/workspace.xml | 10 +++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b97ec3b..7df0e83 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,6 +26,12 @@ dgoss: environment: IMAGE_NAME: rfaircloth/scs + GOSS_VER: v0.3.6 + GOSS_DST: ~/bin + GOSS_PATH: ~/goss + GOSS_OPTS: "--max-concurrent=1 --format junit" + GOSS_FILES_STRATEGY: cp + docker: - image: circleci/buildpack-deps:stretch steps: @@ -42,16 +48,15 @@ name: Install goss command: | # rather than give internet scripts SU rights, we install to local user bin and add to path - mkdir -p ~/bin - curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.6 GOSS_DST=~/bin sh + mkdir -p $GOSS_DST + mkdir -p $GOSS_PATH + curl -fsSL https://goss.rocks/install | sh - run: name: Test Docker command: | - export GOSS_OPTS="--max-concurrent=1 --format junit" - export GOSS_FILES_STRATEGY=cp mkdir -p ~/project/test-results pushd package - GOSS_PATH=~/bin ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + $GOSS_DST/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7eee3da..812bb89 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 7dbf5f14b02ee9766775d6f426e8406344407a7b Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:14:21 -0400 Subject: [PATCH 27/43] path change --- .circleci/config.yml | 2 +- .idea/workspace.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7df0e83..2ddcf81 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ command: | mkdir -p ~/project/test-results pushd package - $GOSS_DST/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 812bb89..33c2af1 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -25,7 +25,7 @@ - + @@ -351,7 +351,7 @@ - @@ -600,7 +600,7 @@ - + From 00d91d0778f06bc1fc35791d6abf812877743731 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:19:26 -0400 Subject: [PATCH 28/43] path fix --- .circleci/config.yml | 10 +++++++--- .idea/workspace.xml | 10 +++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ddcf81..bf1af8c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,15 +48,19 @@ name: Install goss command: | # rather than give internet scripts SU rights, we install to local user bin and add to path - mkdir -p $GOSS_DST - mkdir -p $GOSS_PATH + mkdir ~/bin + export GOSS_DST=~/bin + export PATH=$PATH:~/bin curl -fsSL https://goss.rocks/install | sh + goss -version - run: name: Test Docker command: | mkdir -p ~/project/test-results + # Don't forget path! + export PATH=$PATH:~/bin pushd package - ~/bin/dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 33c2af1..729dff2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 553339f42eb70570b2d73acfaa8a9b8be5cd04e8 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:21:37 -0400 Subject: [PATCH 29/43] opt fix --- .circleci/config.yml | 1 - .idea/workspace.xml | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bf1af8c..a20982c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,6 @@ IMAGE_NAME: rfaircloth/scs GOSS_VER: v0.3.6 GOSS_DST: ~/bin - GOSS_PATH: ~/goss GOSS_OPTS: "--max-concurrent=1 --format junit" GOSS_FILES_STRATEGY: cp diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 729dff2..af867de 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 61ae5ff995ef5d911400bffda64c5a51fdc2aa73 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:27:20 -0400 Subject: [PATCH 30/43] test --- .circleci/config.yml | 2 +- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a20982c..d128813 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,7 +59,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + GOSS_PATH=/cigoss dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index af867de..f00cba4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 8d745cbbbe8b96feeb12ba05288239e68f3e8cc9 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:29:49 -0400 Subject: [PATCH 31/43] retest --- .circleci/config.yml | 3 +-- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d128813..90f6005 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,6 @@ environment: IMAGE_NAME: rfaircloth/scs GOSS_VER: v0.3.6 - GOSS_DST: ~/bin GOSS_OPTS: "--max-concurrent=1 --format junit" GOSS_FILES_STRATEGY: cp @@ -59,7 +58,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_PATH=/cigoss dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f00cba4..be7484b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -599,8 +599,8 @@ - - + + From 70be96016780dc9293b54de9da4d28f7c53b5553 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 21:33:40 -0400 Subject: [PATCH 32/43] test --- .circleci/config.yml | 2 +- .idea/workspace.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 90f6005..02eb291 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + GOSS_FILES_STRATEGY=cp dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index be7484b..4539295 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -25,7 +25,7 @@ - + @@ -351,7 +351,7 @@ - @@ -600,7 +600,7 @@ - + From 5dddea6c7307b518ec2097d5ccde063ab035be5d Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 23:23:24 -0400 Subject: [PATCH 33/43] try again --- .circleci/config.yml | 2 +- .idea/workspace.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02eb291..2df8068 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_FILES_STRATEGY=cp dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + GOSS_FILES_STRATEGY=cp GOSS_FILES_STRATEGY=cp dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4539295..fe7d3f9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -25,7 +25,7 @@ - + @@ -351,7 +351,7 @@ - @@ -600,7 +600,7 @@ - + From 48dc59eb41578492d65d47f5a5b45db38fffeacd Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 23:27:33 -0400 Subject: [PATCH 34/43] test --- .circleci/config.yml | 6 +++--- .idea/workspace.xml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2df8068..3993077 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,8 +47,8 @@ command: | # rather than give internet scripts SU rights, we install to local user bin and add to path mkdir ~/bin - export GOSS_DST=~/bin - export PATH=$PATH:~/bin +# export GOSS_DST=~/bin + # export PATH=$PATH:~/bin curl -fsSL https://goss.rocks/install | sh goss -version - run: @@ -58,7 +58,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_FILES_STRATEGY=cp GOSS_FILES_STRATEGY=cp dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 + GOSS_FILES_STRATEGY=cp dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fe7d3f9..ecfd92d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -380,7 +380,7 @@ - + @@ -599,8 +599,8 @@ - - + + From 649ab806aebf04541e44863af92e465f5037d283 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 23:35:05 -0400 Subject: [PATCH 35/43] move healtcheck config --- .idea/workspace.xml | 32 ++++++++++++++++---------------- package/Dockerfile | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ecfd92d..404df54 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,7 @@ - + - + - - + + - + @@ -70,8 +70,8 @@ @@ -351,7 +351,7 @@ - @@ -366,7 +366,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -587,13 +587,6 @@ - - - - - - - @@ -604,5 +597,12 @@ + + + + + + + \ No newline at end of file diff --git a/package/Dockerfile b/package/Dockerfile index 8846836..1cbb58a 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -70,7 +70,7 @@ ENV DEBCONF_NONINTERACTIVE_SEEN=true ENV SPLUNK_CONNECT_METHOD=hec RUN source scl_source enable rh-python36 ; curl -fsSL https://goss.rocks/install | sh -COPY goss.yaml /goss/goss.yaml +COPY goss.yaml /etc/goss.yaml COPY --from=0 /opt/syslog-ng /opt/syslog-ng COPY scripts/splunkmetrics.sh /opt/syslog-ng/sbin/splunkmetrics.sh @@ -90,4 +90,4 @@ ENV SPLUNK_CONNECT_METHOD=UF ENTRYPOINT ["/sbin/entrypoint.sh", "--"] -HEALTHCHECK --interval=1s --timeout=6s CMD source scl_source enable rh-python36 ;goss -g /goss/goss.yaml validate \ No newline at end of file +HEALTHCHECK --interval=1s --timeout=6s CMD source scl_source enable rh-python36 ;goss -g /etc/goss.yaml validate \ No newline at end of file From 003f4775d881bbd29fbde819a6eb74d864c15ec9 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 23:38:01 -0400 Subject: [PATCH 36/43] version bump --- .circleci/config.yml | 2 +- .idea/workspace.xml | 29 +++++++++++++++-------------- package/Dockerfile | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3993077..860f81e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ mkdir ~/bin # export GOSS_DST=~/bin # export PATH=$PATH:~/bin - curl -fsSL https://goss.rocks/install | sh + curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.7 sh goss -version - run: name: Test Docker diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 404df54..c643852 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + - + - - + + - + - - + + @@ -70,8 +71,8 @@ @@ -351,7 +352,7 @@ - @@ -590,17 +591,17 @@ - + - - + + - + - - + + diff --git a/package/Dockerfile b/package/Dockerfile index 1cbb58a..2c622a1 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -69,7 +69,7 @@ RUN cd /tmp ;\ ENV DEBCONF_NONINTERACTIVE_SEEN=true ENV SPLUNK_CONNECT_METHOD=hec -RUN source scl_source enable rh-python36 ; curl -fsSL https://goss.rocks/install | sh +RUN source scl_source enable rh-python36 ; curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.7 sh COPY goss.yaml /etc/goss.yaml COPY --from=0 /opt/syslog-ng /opt/syslog-ng From b5f4e768acbc012ecfc26d29931e5506939c887f Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Fri, 28 Jun 2019 23:44:33 -0400 Subject: [PATCH 37/43] update --- .circleci/config.yml | 3 +-- .idea/workspace.xml | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 860f81e..6a1c3f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,8 +58,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_FILES_STRATEGY=cp dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 - #3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c643852..aeda2c8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,6 @@ - - @@ -600,8 +599,8 @@ - - + + From ff319755753c527fd84b1e806356dae76ba4b398 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 00:01:06 -0400 Subject: [PATCH 38/43] test --- .circleci/config.yml | 6 +++--- .idea/workspace.xml | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a1c3f6..37ba879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ dgoss: environment: IMAGE_NAME: rfaircloth/scs - GOSS_VER: v0.3.6 + GOSS_VER: v0.3.7 GOSS_OPTS: "--max-concurrent=1 --format junit" GOSS_FILES_STRATEGY: cp @@ -58,7 +58,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" gossdgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: @@ -96,7 +96,7 @@ - build - publish: requires: - - dgoss + - build filters: branches: only: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index aeda2c8..d44e42b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -15,8 +15,8 @@ - - + + @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -366,7 +366,7 @@ - + @@ -375,12 +375,12 @@ - + - + @@ -588,19 +588,23 @@ - + + + + + - - + + - - + + From e2a4e4285fcf030211738a37192e2efbb4b94327 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 00:04:28 -0400 Subject: [PATCH 39/43] test --- .circleci/config.yml | 3 --- .idea/workspace.xml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37ba879..e0d0a10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,9 +46,6 @@ name: Install goss command: | # rather than give internet scripts SU rights, we install to local user bin and add to path - mkdir ~/bin -# export GOSS_DST=~/bin - # export PATH=$PATH:~/bin curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.7 sh goss -version - run: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d44e42b..eeb8659 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -15,8 +15,8 @@ - - + + @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -596,15 +596,15 @@ - - + + - - + + From 05ddd7aeadfbc2ebbc02a6f5b0f5bfdbb2a95465 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 00:06:37 -0400 Subject: [PATCH 40/43] sudo --- .circleci/config.yml | 2 +- .idea/workspace.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e0d0a10..ffa00ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,7 @@ name: Install goss command: | # rather than give internet scripts SU rights, we install to local user bin and add to path - curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.7 sh + curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.7 sudo sh goss -version - run: name: Test Docker diff --git a/.idea/workspace.xml b/.idea/workspace.xml index eeb8659..12429e8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -25,7 +25,7 @@ - + @@ -351,7 +351,7 @@ - @@ -604,7 +604,7 @@ - + From 20948991027b3e33c5c2bf6288551a9de3390cbf Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 00:10:13 -0400 Subject: [PATCH 41/43] test --- .circleci/config.yml | 2 +- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ffa00ca..3498ffe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" gossdgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 12429e8..0901710 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -603,8 +603,8 @@ - - + + From f1d93708158d317a7ae46f95a339723fdafc40fe Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 00:14:47 -0400 Subject: [PATCH 42/43] more details --- .circleci/config.yml | 2 +- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3498ffe..a608993 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,7 @@ # Don't forget path! export PATH=$PATH:~/bin pushd package - GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" + GOSS_FMT_OPTIONS="perfdata verbose" GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" popd cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0901710..e1b14b9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -603,8 +603,8 @@ - - + + From 7f288ded9d9752d5678c2d165894bf2aab9badda Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 00:17:36 -0400 Subject: [PATCH 43/43] order build --- .circleci/config.yml | 2 +- .idea/workspace.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a608993..a616137 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -93,7 +93,7 @@ - build - publish: requires: - - build + - dgoss filters: branches: only: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e1b14b9..44b7535 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,8 +24,8 @@ - - + + @@ -351,7 +351,7 @@ - @@ -603,8 +603,8 @@ - - + +