diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dedbc9..3db7ee2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,19 +28,10 @@ jobs: command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker image - command: docker build -f package/Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RH_ACTIVATION=$RH_ACTIVATION -t $IMAGE_NAME:build package - - run: - name: Tag Docker image - command: docker tag $IMAGE_NAME:build $IMAGE_NAME:$CIRCLE_SHA1 - - run: - name: Tag Docker image - command: docker tag $IMAGE_NAME:build $IMAGE_NAME:edge + command: docker build -f package/Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RH_ACTIVATION=$RH_ACTIVATION -t $IMAGE_NAME:$CIRCLE_SHA1 package - run: name: Push Docker image command: docker push $IMAGE_NAME:$CIRCLE_SHA1 - - run: - name: Push Docker image - command: docker push $IMAGE_NAME:edge build-egb: environment: IMAGE_NAME: rfaircloth/scs @@ -57,13 +48,10 @@ jobs: command: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker image - command: docker build -f perftests/bundlesrv/Dockerfile -t $IMAGE_NAME:egb-build perftests/bundlesrv - - run: - name: Tag Docker image - command: docker tag $IMAGE_NAME:egb-build $IMAGE_NAME:egb-$CIRCLE_SHA1 + command: docker build -f perftests/bundlesrv/Dockerfile -t $IMAGE_NAME:egb-$CIRCLE_SHA1 perftests/bundlesrv - run: name: Tag Docker image - command: docker tag $IMAGE_NAME:egb-build $IMAGE_NAME:egb-edge + command: docker tag $IMAGE_NAME:egb-$CIRCLE_SHA1 $IMAGE_NAME:egb-build - run: name: Push Docker image command: docker push $IMAGE_NAME:egb-$CIRCLE_SHA1 @@ -135,13 +123,13 @@ jobs: registry.access.redhat.com/ubi7/ubi docker cp tests/ dummy:/work/tests/ docker rm dummy - - run: - name: Docker Compose build - command: | - docker-compose build +# - run: +# name: Docker Compose build +# command: | +# docker-compose build - run: name: Docker Compose up - command: docker-compose up --abort-on-container-exit + command: docker-compose -f ./docker-compose-ci.yml up --abort-on-container-exit - run: name: Collect test results from Docker Compose command: | @@ -174,7 +162,7 @@ jobs: - store_artifacts: path: /clair-reports - publish: + publish-common: environment: IMAGE_NAME: rfaircloth/scs docker: @@ -195,6 +183,48 @@ jobs: name: Docker push tag command: docker push $IMAGE_NAME:$CIRCLE_BRANCH + publish-edge: + 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: Docker tag image + command: docker tag $IMAGE_NAME:$CIRCLE_SHA1 $IMAGE_NAME:edge + - run: + name: Docker push tag + command: docker push $IMAGE_NAME:edge + + publish-latest: + 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: Docker tag image + command: docker tag $IMAGE_NAME:$CIRCLE_SHA1 splunk/scs:latest + - run: + name: Docker push tag + command: docker push splunk/scs:latest + workflows: build-publish: jobs: @@ -209,7 +239,7 @@ workflows: - test-scan_images: requires: - build - - publish: + - publish-common: requires: - dgoss - test-unit @@ -218,3 +248,19 @@ workflows: only: - master - develop + - publish-edge: + requires: + - dgoss + - test-unit + filters: + branches: + only: + - develop + - publish-latest: + requires: + - dgoss + - test-unit + filters: + branches: + only: + - master \ No newline at end of file diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml new file mode 100644 index 0000000..b7dbd53 --- /dev/null +++ b/docker-compose-ci.yml @@ -0,0 +1,78 @@ +#Splunk Connect for Syslog (SC4S) by Splunk, Inc. +# +#To the extent possible under law, the person who associated CC0 with +#Splunk Connect for Syslog (SC4S) has waived all copyright and related or neighboring rights +#to Splunk Connect for Syslog (SC4S). +# +#You should have received a copy of the CC0 legalcode along with this +#work. If not, see . +version: "3.2" +services: + test: + build: ./tests + links: + - splunk + - sc4s + volumes: + - sc4s-tests:/work/tests + - sc4s-results:/work/test-results + environment: + - SPLUNK_PASSWORD=${SPLUNK_PASSWORD} + + sc4s: + image: rfaircloth/scs:${CIRCLE_SHA1} + hostname: sc4s + ports: + - "514" + - "601" + - "514/udp" + - "5514" + - "5514/udp" + stdin_open: true + tty: true + links: + - splunk + environment: + - SPLUNK_HEC_URL=${SPLUNK_HEC_URL} + - SPLUNK_HEC_STATSURL=${SPLUNK_HEC_STATSURL} + - SPLUNK_HEC_TOKEN=${SPLUNK_HEC_TOKEN} + - SPLUNK_CONNECT_METHOD=${SPLUNK_CONNECT_METHOD} + - SPLUNK_DEFAULT_INDEX=${SPLUNK_DEFAULT_INDEX} + - SPLUNK_METRICS_INDEX=${SPLUNK_DEFAULT_INDEX} +# logging: +# driver: splunk +# options: +# splunk-token: a778f63a-5dff-4e3c-a72c-a03183659e94 +# splunk-url: https://splunk:8088/services/collector/event +# splunk-index: main +# splunk-insecureskipverify: true +# splunk-verify-connection: false + splunk: + image: splunk/splunk:latest + hostname: splunk + ports: + - "8000:8000" + - "8088:8088" + - "8089:8089" + environment: + - SPLUNK_HEC_TOKEN=${SPLUNK_HEC_TOKEN} + - SPLUNK_PASSWORD=${SPLUNK_PASSWORD} + - SPLUNK_START_ARGS=${SPLUNK_START_ARGS} + - SPLUNK_APPS_URL=${SPLUNK_APPS_URL} + - SPLUNKBASE_USERNAME=${SPLUNKBASE_USERNAME} + - SPLUNKBASE_PASSWORD=${SPLUNKBASE_PASSWORD} + volumes: + - ./splunk/SA-syslog-ng:/opt/splunk/etc/apps/SA-syslog-ng +# logging: +# driver: splunk +# options: +# splunk-token: a778f63a-5dff-4e3c-a72c-a03183659e94 +# splunk-url: https://splunk:8088/services/collector/event +# splunk-index: main +# splunk-insecureskipverify: true +# splunk-verify-connection: false +volumes: + sc4s-tests: + external: true + sc4s-results: + external: true diff --git a/docker-compose.yml b/docker-compose.yml index f13c181..9581236 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ # #You should have received a copy of the CC0 legalcode along with this #work. If not, see . -version: "3" +version: "3.2" services: test: build: ./tests @@ -20,9 +20,13 @@ services: - SPLUNK_PASSWORD=${SPLUNK_PASSWORD} sc4s: - image: rfaircloth/scs:latest + image: splunk/scs:latest build: context: ./package + cache_from: + - registry.access.redhat.com/ubi7/ubi + - registry.access.redhat.com/rhel7/rhel + - rfaircloth/scs:edge args: RH_ORG: ${RH_ORG} RH_ACTIVATION: ${RH_ACTIVATION} diff --git a/docs/gettingstarted.md b/docs/gettingstarted.md index 2d7c971..d1e71cc 100644 --- a/docs/gettingstarted.md +++ b/docs/gettingstarted.md @@ -19,7 +19,7 @@ version: "3" services: sc4s: - image: rfaircloth/scs:latest + image: splunk/scs:latest hostname: sc4s ports: - "514"