Skip to content

Commit

Permalink
Feature/releaseimages (#54)
Browse files Browse the repository at this point in the history
Revise CI process to release builds will publish as splunk/scs:latest
  • Loading branch information
Ryan Faircloth authored and GitHub committed Aug 18, 2019
1 parent a069ff8 commit a477e96
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 25 deletions.
90 changes: 68 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -174,7 +162,7 @@ jobs:
- store_artifacts:
path: /clair-reports

publish:
publish-common:
environment:
IMAGE_NAME: rfaircloth/scs
docker:
Expand All @@ -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:
Expand All @@ -209,7 +239,7 @@ workflows:
- test-scan_images:
requires:
- build
- publish:
- publish-common:
requires:
- dgoss
- test-unit
Expand All @@ -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
78 changes: 78 additions & 0 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
@@ -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 <http://creativecommons.org/publicdomain/zero/1.0/>.
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
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
#You should have received a copy of the CC0 legalcode along with this
#work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
version: "3"
version: "3.2"
services:
test:
build: ./tests
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion docs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
version: "3"
services:
sc4s:
image: rfaircloth/scs:latest
image: splunk/scs:latest
hostname: sc4s
ports:
- "514"
Expand Down

0 comments on commit a477e96

Please sign in to comment.