From 5a6a068c9b5ad331a79fb996ea0981739f0d6fe6 Mon Sep 17 00:00:00 2001 From: zahrasidhpuri-crest Date: Thu, 21 Jan 2021 16:14:42 +0530 Subject: [PATCH] test: Added circle_tag param for publishing --- .circleci/config.yml | 53 +++++++++++++++++++++++++++++++++++++++----- .releaserc.yaml | 6 +---- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ac7302..84e6b2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,9 +33,16 @@ orbs: npx -p @semantic-release/exec -p semantic-release semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,@semantic-release/exec" --analyzeCommits @semantic-release/commit-analyzer --verifyRelease @semantic-release/exec --verifyReleaseCmd 'echo ${nextRelease.version} > nextRelease.txt' sed -i "s/-develop./develop/g" nextRelease.txt VERSION=$(cat nextRelease.txt) - echo "$VERSION" + echo VERSION="$VERSION" source ~/.venv/bin/activate - ucc-gen --ta-version="$VERSION" + if [ -z "$CIRCLE_TAG" ] + then + ucc-gen --ta-version="$VERSION" + else + CIRCLE_TAG=${CIRCLE_TAG:1} + echo CIRCLE_TAG=$CIRCLE_TAG + ucc-gen --ta-version="$CIRCLE_TAG" + fi - run: name: Generating package command: | @@ -495,6 +502,26 @@ jobs: name: "Publish on GitHub" command: | npx semantic-release + + publish-gh: + docker: + - image: circleci/python:3.7 + steps: + - setup_remote_docker: + docker_layer_caching: true + - attach_workspace: + at: /tmp/workspace + - checkout + - go/install + - run: + name: "Publish on GitHub" + command: | + PATH=$PATH:/usr/local/go/bin + go get -v -u github.com/tcnksm/ghr + [[ << pipeline.git.tag >> =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] || export ISPRE=-prerelease + $HOME/go/bin/ghr -t ${GH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} -delete "<< pipeline.git.tag >>" /tmp/workspace/build/package/splunkbase + $HOME/go/bin/ghr -t ${GH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} "<< pipeline.git.tag >>" /tmp/workspace/build/package/deployment + publish-sbase: docker: - image: circleci/python:3.7 @@ -568,6 +595,7 @@ workflows: requires: - package matrix: + alias: splunk-app-test-knowledge parameters: splunk_version: ["7.2","7.3","8.0","8.1"] sc4s_version: ["1"] @@ -582,6 +610,7 @@ workflows: requires: - package matrix: + alias: splunk-app-test-ui parameters: splunk_version: ["7.3","8.0","8.1"] sc4s_version: ["1"] @@ -595,6 +624,7 @@ workflows: requires: - package matrix: + alias: splunk-app-test-modinput parameters: splunk_version: ["7.3","8.0","8.1"] sc4s_version: ["1"] @@ -629,6 +659,12 @@ workflows: - approval-release: requires: - package + # - splunk-app-inspect + # - splunk-app-test-knowledge + # - splunk-app-test-ui + # - splunk-app-test-modinput + # - splunk-app-unit-test + # - splunk-app-backend-test context: - gdi-github type: approval @@ -640,9 +676,6 @@ workflows: - release: requires: - approval-release -## - splunk-app-inspect -## - splunk-app-unit-test -## - splunk-app-backend-test context: - gdi-github publish: @@ -654,6 +687,16 @@ workflows: ignore: /.*/ tags: only: /^v\d*\.\d*\.\d*.*$/ + - publish-gh: + context: + - gdi-github + requires: + - package + filters: + branches: + ignore: /.*/ + tags: + only: /^v\d*\.\d*\.\d*.*$/ - publish-sbase: context: - gdi-splunkbase diff --git a/.releaserc.yaml b/.releaserc.yaml index 7095f3d..bc5e7d0 100644 --- a/.releaserc.yaml +++ b/.releaserc.yaml @@ -7,8 +7,4 @@ branches: prerelease: true plugins: - "@semantic-release/commit-analyzer" - - "@semantic-release/release-notes-generator" - - - "@semantic-release/github" - - assets: - - /tmp/workspace/build/package/splunkbase/* - - /tmp/workspace/build/package/deployment/* \ No newline at end of file + - "@semantic-release/release-notes-generator" \ No newline at end of file