From efd34b1b3f1b7a4a6d82329c686809ae8a442d3f Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 19 Feb 2020 16:28:48 -0500 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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