From efd34b1b3f1b7a4a6d82329c686809ae8a442d3f Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 16:28:48 -0500 Subject: [PATCH 01/26] Update config.yml --- .circleci/config.yml | 209 ++++++++++++++++++++++--------------------- 1 file changed, 105 insertions(+), 104 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b6ea4e..cec8cbb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,55 +39,55 @@ test: &test - store_test_results: path: test-results -publish: &publish - steps: - - setup_remote_docker: - docker_layer_caching: true - - checkout - - run: - name: Docker Login - command: | - docker login -u $DOCKER_USER -p $DOCKER_PASS - - semver-orb/export-tag - - run: - name: Build SC4S - command: | - echo $SEMVER_VERSION >package/VERSION - if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi - docker build --build-arg BRANCH=${SYSLOG} package \ - -t splunk/scs:${VERSION} - - run: - name: Docker Save - command: | - mkdir -p /tmp/workspace/ - if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi - docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz - - run: - name: BYOE Config - command: | - tar rvf /tmp/workspace/baremetal.tar -C package/etc . - tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh - - docker/push: - image: splunk/scs - tag: $DOCKER_TAG - - go/install - - run: - name: "Publish edge on GitHub" - command: | - PATH=$PATH:/usr/local/go/bin - go get -v -u github.com/tcnksm/ghr - if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi - $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${GHR_FLAGS} -delete ${VERSION} /tmp/workspace/ +# publish: &publish +# steps: +# - setup_remote_docker: +# docker_layer_caching: true +# - checkout +# - run: +# name: Docker Login +# command: | +# docker login -u $DOCKER_USER -p $DOCKER_PASS +# - semver-orb/export-tag +# - run: +# name: Build SC4S +# command: | +# echo $SEMVER_VERSION >package/VERSION +# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi +# docker build --build-arg BRANCH=${SYSLOG} package \ +# -t splunk/scs:${VERSION} +# - run: +# name: Docker Save +# command: | +# mkdir -p /tmp/workspace/ +# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi +# docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz +# - run: +# name: BYOE Config +# command: | +# tar rvf /tmp/workspace/baremetal.tar -C package/etc . +# tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh +# - docker/push: +# image: splunk/scs +# tag: $DOCKER_TAG +# - go/install +# - run: +# name: "Publish edge on GitHub" +# command: | +# PATH=$PATH:/usr/local/go/bin +# go get -v -u github.com/tcnksm/ghr +# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi +# $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${GHR_FLAGS} -delete ${VERSION} /tmp/workspace/ - - store_artifacts: - path: /tmp/workspace/ +# - store_artifacts: +# path: /tmp/workspace/ orbs: - docker: circleci/docker@0.5.20 - go: circleci/go@0.2.0 - snyk: snyk/snyk@0.0.8 - versioning: kollex/versioning@1.0.0 - semver-orb: tv2norge/semver-orb@0.0.1 + # docker: circleci/docker@0.5.20 + # go: circleci/go@0.2.0 + # snyk: snyk/snyk@0.0.8 + # versioning: kollex/versioning@1.0.0 + # semver-orb: tv2norge/semver-orb@0.0.1 jobs: test-sc4s-3-25-1-splunk-8-0: @@ -119,30 +119,31 @@ jobs: SPLUNK: "7-2" <<: *test - publish-edge: - docker: - - image: circleci/python:3.7 - environment: - SYSLOG: "syslog-ng-3.25.1" - SPLUNK: "8.0" - DOCKER_TAG: edge - GHR_FLAGS: -prerelease - <<: *publish - publish-latest: - docker: - - image: circleci/python:3.7 - environment: - SYSLOG: "syslog-ng-3.25.1" - SPLUNK: "8.0" - DOCKER_TAG: latest - <<: *publish - publish-tag: - docker: - - image: circleci/python:3.7 - environment: - SYSLOG: "3.25.1" - SPLUNK: "8.0" - <<: *publish + # publish-edge: + # docker: + # - image: circleci/python:3.7 + # environment: + # SYSLOG: "syslog-ng-3.25.1" + # SPLUNK: "8.0" + # DOCKER_TAG: edge + # GHR_FLAGS: -prerelease + # <<: *publish + # publish-latest: + # docker: + # - image: circleci/python:3.7 + # environment: + # SYSLOG: "syslog-ng-3.25.1" + # SPLUNK: "8.0" + # DOCKER_TAG: latest + # <<: *publish + # publish-tag: + # docker: + # - image: circleci/python:3.7 + # environment: + # SYSLOG: "3.25.1" + # SPLUNK: "8.0" + # <<: *publish + workflows: version: 2 build_and_deploy: @@ -151,37 +152,37 @@ workflows: - test-sc4s-master-splunk-8-0 - test-sc4s-3-25-1-splunk-7-3 - test-sc4s-3-25-1-splunk-7-2 - - publish-pre-gh-edge: - type: approval - requires: - - test-sc4s-3-25-1-splunk-8-0 - filters: - branches: - only: - - develop - - publish-edge: - requires: - - publish-pre-gh-edge - - publish-pre-gh-latest: - type: approval - requires: - - test-sc4s-3-25-1-splunk-8-0 - filters: - branches: - only: - - master - - publish-latest: - requires: - - publish-pre-gh-latest - - publish-pre-gh-tag: - type: approval - requires: - - test-sc4s-3-25-1-splunk-8-0 - filters: - tags: - only: /^\d*\.\d*\.\d*.*$/ - branches: - ignore: /.*/ - - publish-tag: - requires: - - publish-pre-gh-tag + # - publish-pre-gh-edge: + # type: approval + # requires: + # - test-sc4s-3-25-1-splunk-8-0 + # filters: + # branches: + # only: + # - develop + # - publish-edge: + # requires: + # - publish-pre-gh-edge + # - publish-pre-gh-latest: + # type: approval + # requires: + # - test-sc4s-3-25-1-splunk-8-0 + # filters: + # branches: + # only: + # - master + # - publish-latest: + # requires: + # - publish-pre-gh-latest + # - publish-pre-gh-tag: + # type: approval + # requires: + # - test-sc4s-3-25-1-splunk-8-0 + # filters: + # tags: + # only: /^\d*\.\d*\.\d*.*$/ + # branches: + # ignore: /.*/ + # - publish-tag: + # requires: + # - publish-pre-gh-tag From 64661e00e0ea413bd7acccedaa0cb6fc38bd1c68 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 16:36:36 -0500 Subject: [PATCH 02/26] Update config.yml --- .circleci/config.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cec8cbb..607889e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,11 @@ test: &test command: | pip install -r tests/requirements.txt mkdir test-results - - semver-orb/export-tag + _ run: + name: Version + command: | + VERSION=$(./semtag getcurrent) + echo ${VERSION} >package/VERSION - run: name: test command: | @@ -82,12 +86,12 @@ test: &test # - store_artifacts: # path: /tmp/workspace/ -orbs: - # docker: circleci/docker@0.5.20 - # go: circleci/go@0.2.0 - # snyk: snyk/snyk@0.0.8 - # versioning: kollex/versioning@1.0.0 - # semver-orb: tv2norge/semver-orb@0.0.1 +#orbs: +# docker: circleci/docker@0.5.20 +# go: circleci/go@0.2.0 +# snyk: snyk/snyk@0.0.8 +# versioning: kollex/versioning@1.0.0 +# semver-orb: tv2norge/semver-orb@0.0.1 jobs: test-sc4s-3-25-1-splunk-8-0: From 4591508b49c94af93353785be6941ec3c26409b6 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 16:48:46 -0500 Subject: [PATCH 03/26] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 607889e..c576e77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ version: 2.1 test: &test steps: - - checkout + - checkout: - setup_remote_docker: docker_layer_caching: true - run: From 3ac61b4f8facfff989ff35c9650b7294396ec58e Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 16:51:47 -0500 Subject: [PATCH 04/26] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c576e77..b3cff0b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ test: &test command: | pip install -r tests/requirements.txt mkdir test-results - _ run: + - run: name: Version command: | VERSION=$(./semtag getcurrent) From cec2138868e0f2a44626ed8b3ff976af7f409bc4 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 16:54:47 -0500 Subject: [PATCH 05/26] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b3cff0b..f8d819b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ version: 2.1 test: &test steps: - - checkout: + - checkout - setup_remote_docker: docker_layer_caching: true - run: @@ -120,7 +120,7 @@ jobs: - image: circleci/python:3.7 environment: SYSLOG: "syslog-ng-3.25.1" - SPLUNK: "7-2" + SPLUNK: "7.2" <<: *test # publish-edge: From 83fb9f6bafbcee95a769479f3d8d1ebc65c9ee27 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 17:21:18 -0500 Subject: [PATCH 06/26] Update config.yml --- .circleci/config.yml | 45 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8d819b..c9122c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,7 @@ test: &test name: Version command: | VERSION=$(./semtag getcurrent) + echo $VERSION echo ${VERSION} >package/VERSION - run: name: test @@ -43,6 +44,18 @@ test: &test - store_test_results: path: test-results +tag: &tag + steps: + - checkout + - add_ssh_keys: + fingerprints: + - "7c:e9:cc:8d:8e:4d:9c:17:1d:e3:96:23:ce:bd:a4:c3" + - checkout + - run: + name: TAG + command: | + ./semtag ${SEMTAG} + # publish: &publish # steps: # - setup_remote_docker: @@ -150,12 +163,34 @@ jobs: workflows: version: 2 - build_and_deploy: + build_test: jobs: - - test-sc4s-3-25-1-splunk-8-0 - - test-sc4s-master-splunk-8-0 - - test-sc4s-3-25-1-splunk-7-3 - - test-sc4s-3-25-1-splunk-7-2 + - test-sc4s-3-25-1-splunk-8-0: + filters: + branches: + only: /.*/ + - test-sc4s-master-splunk-8-0: + filters: + branches: + only: /.*/ + - test-sc4s-3-25-1-splunk-7-3: + filters: + branches: + only: /.*/ + - test-sc4s-3-25-1-splunk-7-2: + filters: + branches: + only: /.*/ + - approval-tag-beta: + requires: + - tag-alpha + type: approval + filters: + branches: + only: develop + - tag-beta: + requires: + - approval-tag-beta # - publish-pre-gh-edge: # type: approval # requires: From 936efd56b162c8e3d093e3fee6cf38d2197f155a Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 17:35:58 -0500 Subject: [PATCH 07/26] Update config.yml --- .circleci/config.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c9122c7..35d4843 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,6 +136,43 @@ jobs: SPLUNK: "7.2" <<: *test + tag-alpha: + docker: + - image: circleci/python:3.7 + environment: + SEMTAG: "alpha" + <<: *tag + tag-beta: + docker: + - image: circleci/python:3.7 + environment: + SEMTAG: "beta" + <<: *tag + tag-candidate: + docker: + - image: circleci/python:3.7 + environment: + SEMTAG: "candidate" + <<: *tag + tag-final-major: + docker: + - image: circleci/python:3.7 + environment: + SEMTAG: "final -s major" + <<: *tag + tag-final-minor: + docker: + - image: circleci/python:3.7 + environment: + SEMTAG: "final -s minor" + <<: *tag + tag-final-patch: + docker: + - image: circleci/python:3.7 + environment: + SEMTAG: "final -s patch" + <<: *tag + # publish-edge: # docker: # - image: circleci/python:3.7 From 47772dca3cdfb62f855e0c2767469100afcbf174 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 17:36:53 -0500 Subject: [PATCH 08/26] Update config.yml --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35d4843..c0f8ada 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -218,6 +218,9 @@ workflows: filters: branches: only: /.*/ + - tag-alpha: + requires: + - approval-tag-alpha - approval-tag-beta: requires: - tag-alpha From aacdf0f20949ec0b418d8246cede16888e7035f1 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 17:37:38 -0500 Subject: [PATCH 09/26] Update config.yml --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c0f8ada..81f82f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -218,6 +218,11 @@ workflows: filters: branches: only: /.*/ + - approval-tag-alpha: + type: approval + filters: + branches: + only: develop - tag-alpha: requires: - approval-tag-alpha From bb35baeffccfedfdb19f6fa0cbfd00db87111e73 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:12:25 -0500 Subject: [PATCH 10/26] Update config.yml --- .circleci/config.yml | 174 +++++++++++++++++++++++++------------------ 1 file changed, 100 insertions(+), 74 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 81f82f7..96a5663 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,56 +56,6 @@ tag: &tag command: | ./semtag ${SEMTAG} -# publish: &publish -# steps: -# - setup_remote_docker: -# docker_layer_caching: true -# - checkout -# - run: -# name: Docker Login -# command: | -# docker login -u $DOCKER_USER -p $DOCKER_PASS -# - semver-orb/export-tag -# - run: -# name: Build SC4S -# command: | -# echo $SEMVER_VERSION >package/VERSION -# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi -# docker build --build-arg BRANCH=${SYSLOG} package \ -# -t splunk/scs:${VERSION} -# - run: -# name: Docker Save -# command: | -# mkdir -p /tmp/workspace/ -# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi -# docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz -# - run: -# name: BYOE Config -# command: | -# tar rvf /tmp/workspace/baremetal.tar -C package/etc . -# tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh -# - docker/push: -# image: splunk/scs -# tag: $DOCKER_TAG -# - go/install -# - run: -# name: "Publish edge on GitHub" -# command: | -# PATH=$PATH:/usr/local/go/bin -# go get -v -u github.com/tcnksm/ghr -# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi -# $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${GHR_FLAGS} -delete ${VERSION} /tmp/workspace/ - -# - store_artifacts: -# path: /tmp/workspace/ - -#orbs: -# docker: circleci/docker@0.5.20 -# go: circleci/go@0.2.0 -# snyk: snyk/snyk@0.0.8 -# versioning: kollex/versioning@1.0.0 -# semver-orb: tv2norge/semver-orb@0.0.1 - jobs: test-sc4s-3-25-1-splunk-8-0: docker: @@ -173,30 +123,96 @@ jobs: SEMTAG: "final -s patch" <<: *tag - # publish-edge: - # docker: - # - image: circleci/python:3.7 - # environment: - # SYSLOG: "syslog-ng-3.25.1" - # SPLUNK: "8.0" - # DOCKER_TAG: edge - # GHR_FLAGS: -prerelease - # <<: *publish - # publish-latest: - # docker: - # - image: circleci/python:3.7 - # environment: - # SYSLOG: "syslog-ng-3.25.1" - # SPLUNK: "8.0" - # DOCKER_TAG: latest - # <<: *publish - # publish-tag: - # docker: - # - image: circleci/python:3.7 - # environment: - # SYSLOG: "3.25.1" - # SPLUNK: "8.0" - # <<: *publish + publish: + docker: + - image: circleci/python:3.7 + steps: + - setup_remote_docker: + docker_layer_caching: true + - attach_workspace: + at: /tmp/workspace + - checkout + - run: + name: Docker Login + command: | + docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: + name: Build SC4S + command: | + if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="$(./semtag getcurrent)"; fi + echo ${VERSION} >package/VERSION + echo ${CIRCLE_SHA1}=${VERSION} + docker build --build-arg BRANCH=${SYSLOG} package -t splunk/scs:${CIRCLE_SHA1} + docker tag -t splunk/scs:${CIRCLE_SHA1} splunk/scs:${VERSION} + + #- go/install + # - run: + # name: "Publish edge on GitHub" + # command: | + # PATH=$PATH:/usr/local/go/bin + # go get -v -u github.com/tcnksm/ghr + # if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi + # PACKAGE=$(ls /tmp/workspace/build/package/splunkbase/*) + # [ "$(./semtag getfinal)" != "${CIRCLE_TAG}" ] && ISPRE="-prerelease" || ISPRE="" + # $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} -delete ${VERSION} $PACKAGE + +# - run: +# name: Build SC4S +# command: | +# echo $SEMVER_VERSION >package/VERSION +# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi +# docker build --build-arg BRANCH=${SYSLOG} package \ +# -t splunk/scs:${VERSION} +# - run: +# name: Docker Save +# command: | +# mkdir -p /tmp/workspace/ +# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi +# docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz +# - run: +# name: BYOE Config +# command: | +# tar rvf /tmp/workspace/baremetal.tar -C package/etc . +# tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh +# - docker/push: +# image: splunk/scs +# tag: $DOCKER_TAG +# - go/install +# - run: +# name: "Publish edge on GitHub" +# command: | +# PATH=$PATH:/usr/local/go/bin +# go get -v -u github.com/tcnksm/ghr +# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi +# $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${GHR_FLAGS} -delete ${VERSION} /tmp/workspace/ + +# - store_artifacts: +# path: /tmp/workspace/ + +# publish-edge: +# docker: +# - image: circleci/python:3.7 +# environment: +# SYSLOG: "syslog-ng-3.25.1" +# SPLUNK: "8.0" +# DOCKER_TAG: edge +# GHR_FLAGS: -prerelease +# <<: *publish +# publish-latest: +# docker: +# - image: circleci/python:3.7 +# environment: +# SYSLOG: "syslog-ng-3.25.1" +# SPLUNK: "8.0" +# DOCKER_TAG: latest +# <<: *publish +# publish-tag: +# docker: +# - image: circleci/python:3.7 +# environment: +# SYSLOG: "3.25.1" +# SPLUNK: "8.0" +# <<: *publish workflows: version: 2 @@ -236,6 +252,16 @@ workflows: - tag-beta: requires: - approval-tag-beta + publish: + jobs: + - publish: + requires: + - package + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*.*$/ # - publish-pre-gh-edge: # type: approval # requires: From ef4d8b4c3c323c0c5b5d17adb83f38069b0382c7 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:13:05 -0500 Subject: [PATCH 11/26] Update config.yml --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96a5663..b40025f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -255,8 +255,6 @@ workflows: publish: jobs: - publish: - requires: - - package filters: branches: ignore: /.*/ From 83ca5698f13e0a98bb0baa83c8e1a14d691e9a72 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:15:27 -0500 Subject: [PATCH 12/26] Update config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b40025f..8df23ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,6 +126,8 @@ jobs: publish: docker: - image: circleci/python:3.7 + environment: + SYSLOG: "syslog-ng-3.25.1" steps: - setup_remote_docker: docker_layer_caching: true From 738edb5d5fa140fa5dcb00a4afbf9d0dea17b153 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:17:28 -0500 Subject: [PATCH 13/26] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8df23ae..ab1b76f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: echo ${VERSION} >package/VERSION echo ${CIRCLE_SHA1}=${VERSION} docker build --build-arg BRANCH=${SYSLOG} package -t splunk/scs:${CIRCLE_SHA1} - docker tag -t splunk/scs:${CIRCLE_SHA1} splunk/scs:${VERSION} + docker tag splunk/scs:${CIRCLE_SHA1} splunk/scs:${VERSION} #- go/install # - run: From fe5c3d4e7ce525346aa600b6e1746c6a690b0de0 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:23:35 -0500 Subject: [PATCH 14/26] Update config.yml --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab1b76f..5815372 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,6 +146,10 @@ jobs: echo ${CIRCLE_SHA1}=${VERSION} docker build --build-arg BRANCH=${SYSLOG} package -t splunk/scs:${CIRCLE_SHA1} docker tag splunk/scs:${CIRCLE_SHA1} splunk/scs:${VERSION} + docker tag splunk/scs:${CIRCLE_SHA1} splunk/scs:${CIRCLE_SHA1:0:7} + docker push splunk/scs:${CIRCLE_SHA1} + docker push splunk/scs:${VERSION} + docker push splunk/scs:${CIRCLE_SHA1:0:7} #- go/install # - run: From 5be6e86b30c3e477f9bdc911633ab1e4ccfa32a3 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:31:41 -0500 Subject: [PATCH 15/26] Update config.yml --- .circleci/config.yml | 87 ++++++++++---------------------------------- 1 file changed, 19 insertions(+), 68 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5815372..355c6db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -138,6 +138,11 @@ jobs: name: Docker Login command: | docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: + name: BYOE Config + command: | + tar rvf /tmp/workspace/baremetal.tar -C package/etc . + tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh - run: name: Build SC4S command: | @@ -150,75 +155,21 @@ jobs: docker push splunk/scs:${CIRCLE_SHA1} docker push splunk/scs:${VERSION} docker push splunk/scs:${CIRCLE_SHA1:0:7} + docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz + - go/install + - run: + name: "Publish on GitHub" + command: | + go get -v -u github.com/tcnksm/ghr + PATH=$PATH:/usr/local/go/bin + if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="$(./semtag getcurrent)"; fi + echo ${VERSION} >package/VERSION + if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi + [ "$(./semtag getfinal)" != "${CIRCLE_TAG}" ] && ISPRE="-prerelease" || ISPRE="" + $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} -delete ${VERSION} /tmp/workspace/ - #- go/install - # - run: - # name: "Publish edge on GitHub" - # command: | - # PATH=$PATH:/usr/local/go/bin - # go get -v -u github.com/tcnksm/ghr - # if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi - # PACKAGE=$(ls /tmp/workspace/build/package/splunkbase/*) - # [ "$(./semtag getfinal)" != "${CIRCLE_TAG}" ] && ISPRE="-prerelease" || ISPRE="" - # $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} -delete ${VERSION} $PACKAGE - -# - run: -# name: Build SC4S -# command: | -# echo $SEMVER_VERSION >package/VERSION -# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi -# docker build --build-arg BRANCH=${SYSLOG} package \ -# -t splunk/scs:${VERSION} -# - run: -# name: Docker Save -# command: | -# mkdir -p /tmp/workspace/ -# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi -# docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz -# - run: -# name: BYOE Config -# command: | -# tar rvf /tmp/workspace/baremetal.tar -C package/etc . -# tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh -# - docker/push: -# image: splunk/scs -# tag: $DOCKER_TAG -# - go/install -# - run: -# name: "Publish edge on GitHub" -# command: | -# PATH=$PATH:/usr/local/go/bin -# go get -v -u github.com/tcnksm/ghr -# if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi -# $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${GHR_FLAGS} -delete ${VERSION} /tmp/workspace/ - -# - store_artifacts: -# path: /tmp/workspace/ - -# publish-edge: -# docker: -# - image: circleci/python:3.7 -# environment: -# SYSLOG: "syslog-ng-3.25.1" -# SPLUNK: "8.0" -# DOCKER_TAG: edge -# GHR_FLAGS: -prerelease -# <<: *publish -# publish-latest: -# docker: -# - image: circleci/python:3.7 -# environment: -# SYSLOG: "syslog-ng-3.25.1" -# SPLUNK: "8.0" -# DOCKER_TAG: latest -# <<: *publish -# publish-tag: -# docker: -# - image: circleci/python:3.7 -# environment: -# SYSLOG: "3.25.1" -# SPLUNK: "8.0" -# <<: *publish + - store_artifacts: + path: /tmp/workspace/ workflows: version: 2 From efbb5e41cafdd0b7b855ae6e6c79f5788b47cf34 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:32:30 -0500 Subject: [PATCH 16/26] Update config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 355c6db..705d64b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,8 @@ #You should have received a copy of the CC0 legalcode along with this #work. If not, see . version: 2.1 +orbs: + go: circleci/go@0.2.0 test: &test steps: From 7a89420d47d1963a9a070affd62a6fe82d74f5bf Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 18:42:25 -0500 Subject: [PATCH 17/26] Update config.yml --- .circleci/config.yml | 93 ++++++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 34 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 705d64b..4e41182 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,6 +125,26 @@ jobs: SEMTAG: "final -s patch" <<: *tag + merge-beta-to-master: + docker: + - image: circleci/python:3.7 + steps: + - checkout + - add_ssh_keys: + fingerprints: + - "73:9c:f8:91:b0:cc:4a:d5:17:af:ce:fc:61:69:ab:92" + - checkout + - run: + name: Merge + command: | + git config --global user.email "addonreleasesrv@splunk.com" + git config --global user.name "Add on release service" + git pull origin master + git merge master -m "Merge from master" + git checkout master + git merge develop + git push + publish: docker: - image: circleci/python:3.7 @@ -211,6 +231,45 @@ workflows: - tag-beta: requires: - approval-tag-beta + - approval-merge-beta-to-master: + requires: + - tag-beta + type: approval + filters: + branches: + only: develop + - merge-beta-to-master: + requires: + - approval-merge-beta-to-master + filters: + branches: + only: develop + - tag-candidate: + filters: + branches: + only: master + - approval-tag-final-major: + type: approval + requires: + - tag-candidate + - tag-final-major: + requires: + - approval-tag-final-major + - approval-tag-final-minor: + type: approval + requires: + - tag-candidate + - tag-final-minor: + requires: + - approval-tag-final-minor + - approval-tag-final-patch: + type: approval + requires: + - tag-candidate + - tag-final-patch: + requires: + - approval-tag-final-patch + publish: jobs: - publish: @@ -219,37 +278,3 @@ workflows: ignore: /.*/ tags: only: /^v\d*\.\d*\.\d*.*$/ - # - publish-pre-gh-edge: - # type: approval - # requires: - # - test-sc4s-3-25-1-splunk-8-0 - # filters: - # branches: - # only: - # - develop - # - publish-edge: - # requires: - # - publish-pre-gh-edge - # - publish-pre-gh-latest: - # type: approval - # requires: - # - test-sc4s-3-25-1-splunk-8-0 - # filters: - # branches: - # only: - # - master - # - publish-latest: - # requires: - # - publish-pre-gh-latest - # - publish-pre-gh-tag: - # type: approval - # requires: - # - test-sc4s-3-25-1-splunk-8-0 - # filters: - # tags: - # only: /^\d*\.\d*\.\d*.*$/ - # branches: - # ignore: /.*/ - # - publish-tag: - # requires: - # - publish-pre-gh-tag From 6ef02c7559c4309083d44dcdd6b5c1b92d25a1b2 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 19:03:01 -0500 Subject: [PATCH 18/26] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4e41182..443ac32 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -178,6 +178,7 @@ jobs: docker push splunk/scs:${VERSION} docker push splunk/scs:${CIRCLE_SHA1:0:7} docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz + [ "$(./semtag getfinal)" != "${CIRCLE_TAG}" ] && echo ampre || echo amnotpre - go/install - run: name: "Publish on GitHub" @@ -185,8 +186,7 @@ jobs: go get -v -u github.com/tcnksm/ghr PATH=$PATH:/usr/local/go/bin if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="$(./semtag getcurrent)"; fi - echo ${VERSION} >package/VERSION - if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="${DOCKER_TAG}"; fi + echo ${VERSION} >package/VERSION [ "$(./semtag getfinal)" != "${CIRCLE_TAG}" ] && ISPRE="-prerelease" || ISPRE="" $HOME/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} -delete ${VERSION} /tmp/workspace/ From a6371b16fd5e5ad4119e7a2b96e07f54b7d61c56 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 19:36:53 -0500 Subject: [PATCH 19/26] Update config.yml --- .circleci/config.yml | 79 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 443ac32..f0eb312 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,27 @@ tag: &tag command: | ./semtag ${SEMTAG} +docker_tag: &docker_tag + steps: + - checkout + + - setup_remote_docker: + docker_layer_caching: true + - run: + name: Build Docker + command: | + if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="$(./semtag getcurrent)"; fi + echo ${VERSION} >package/VERSION + echo ${CIRCLE_SHA1}=${VERSION} + VERSION_DOCKER_M=$(echo $VERSION | sed -n 's/v\([0-9]\).*/\1/p') + VERSION_DOCKER_MM=$(echo $VERSION | sed -n 's/v\([0-9]*\.[0-9]*\).*/\1/p') + VERSION_DOCKER_MMP=$(echo $VERSION | sed -n 's/v\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p') + [ "$SEM_LEVEL" = "M" ] && TAG=$VERSION_DOCKER_M + [ "$SEM_LEVEL" = "MM" ] && TAG=$VERSION_DOCKER_MM + [ "$SEM_LEVEL" = "latest" ] && TAG=latest + docker pull splunk/scs:${CIRCLE_SHA1} + docker tag splunk/scs:${CIRCLE_SHA1} splunk/scs:${SEM_LEVEL} + docker push splunk/scs:${SEM_LEVEL} jobs: test-sc4s-3-25-1-splunk-8-0: docker: @@ -125,6 +146,25 @@ jobs: SEMTAG: "final -s patch" <<: *tag + docker-major: + docker: + - image: circleci/python:3.7 + environment: + SEM_LEVEL: "M" + <<: *docker_tag + docker-minor: + docker: + - image: circleci/python:3.7 + environment: + SEM_LEVEL: "MM" + <<: *docker_tag + docker-latest: + docker: + - image: circleci/python:3.7 + environment: + SEM_LEVEL: "latest" + <<: *docker_tag + merge-beta-to-master: docker: - image: circleci/python:3.7 @@ -166,7 +206,7 @@ jobs: tar rvf /tmp/workspace/baremetal.tar -C package/etc . tar rvf /tmp/workspace/baremetal.tar -C package/sbin entrypoint.sh - run: - name: Build SC4S + name: Build Docker command: | if [ -n "${CIRCLE_TAG}" ]; then VERSION=${CIRCLE_TAG}; else VERSION="$(./semtag getcurrent)"; fi echo ${VERSION} >package/VERSION @@ -178,7 +218,6 @@ jobs: docker push splunk/scs:${VERSION} docker push splunk/scs:${CIRCLE_SHA1:0:7} docker save splunk/scs:${VERSION} | gzip -c > /tmp/workspace/oci_container.tar.gz - [ "$(./semtag getfinal)" != "${CIRCLE_TAG}" ] && echo ampre || echo amnotpre - go/install - run: name: "Publish on GitHub" @@ -278,3 +317,39 @@ workflows: ignore: /.*/ tags: only: /^v\d*\.\d*\.\d*.*$/ + - approval-docker-major: + type: approval + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*$/ + requires: + - publish + - docker-major: + requires: + - approval-docker-major + - approval-docker-minor: + type: approval + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*$/ + requires: + - publish + - docker-minor: + requires: + - approval-docker-minor + - approval-docker-latest: + type: approval + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*$/ + requires: + - publish + - docker-latest: + requires: + - approval-docker-latest From f2694b4478851ff44acb208b5ef834911650bf6e Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 19:50:09 -0500 Subject: [PATCH 20/26] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f0eb312..d7f096b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -172,7 +172,7 @@ jobs: - checkout - add_ssh_keys: fingerprints: - - "73:9c:f8:91:b0:cc:4a:d5:17:af:ce:fc:61:69:ab:92" + - "7c:e9:cc:8d:8e:4d:9c:17:1d:e3:96:23:ce:bd:a4:c3" - checkout - run: name: Merge From d5316461bab2e43a60432c64abc199f1d9a36a08 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 20:12:45 -0500 Subject: [PATCH 21/26] Update config.yml --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d7f096b..50d1f90 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -341,6 +341,11 @@ workflows: - docker-minor: requires: - approval-docker-minor + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*$/ - approval-docker-latest: type: approval filters: @@ -353,3 +358,8 @@ workflows: - docker-latest: requires: - approval-docker-latest + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*$/ From 1bf14414199c5c476b431459eece830831b256c9 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 20:23:26 -0500 Subject: [PATCH 22/26] Update config.yml --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50d1f90..e7c3079 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,10 @@ docker_tag: &docker_tag - setup_remote_docker: docker_layer_caching: true + - run: + name: Docker Login + command: | + docker login -u $DOCKER_USER -p $DOCKER_PASS - run: name: Build Docker command: | From 3c0d42768056079a4bbfe5856402cbabb4cbf648 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 20:27:02 -0500 Subject: [PATCH 23/26] Update config.yml --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7c3079..c2be80b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -333,6 +333,11 @@ workflows: - docker-major: requires: - approval-docker-major + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*$/ - approval-docker-minor: type: approval filters: From 4c2a0205211bb0f5634e40d79914677d0e44aad7 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Thu, 20 Feb 2020 10:00:04 -0500 Subject: [PATCH 24/26] Update mkdocs.yml --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 98c30ca..b4de5de 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,6 +21,7 @@ nav: - Forcepoint: sources/Forcepoint/index.md - Fortinet: sources/Fortinet/index.md - Imperva: sources/Imperva/index.md + - InfoBlox: sources/InfoBlox/index.md - Juniper: sources/Juniper/index.md - Microfocus: sources/Microfocus/index.md - Nix: sources/nix/index.md From c6944feb1902c60ee7bc2ed89559b3f7f5932018 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Thu, 20 Feb 2020 10:22:23 -0500 Subject: [PATCH 25/26] Update requirements.txt --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 5bb5756..84f4d17 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -9,7 +9,7 @@ pytest jinja2 jinja2-time -splunk-sdk +splunk-sdk=1.6.11 flake8 pytz flaky From 56eff965f8e35c118456d6adb8b29e834dd0f676 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Thu, 20 Feb 2020 10:30:26 -0500 Subject: [PATCH 26/26] Update requirements.txt --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 84f4d17..6a2c130 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -9,7 +9,7 @@ pytest jinja2 jinja2-time -splunk-sdk=1.6.11 +splunk-sdk==1.6.11 flake8 pytz flaky