From 7ee6890fd5560e1145f4fd64aed0d0849006d633 Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 14:25:23 -0300 Subject: [PATCH 1/7] . --- .circleci/config.yml | 57 ++++++++++++++++++++++---------------------- Makefile | 6 ++--- version.sh | 1 + 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d82810155..65cdcbf86 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,6 +25,7 @@ references: branches: only: - /^release-.*/ + - fix/changelog filters-checks: &FILTERS_CHECK branches: @@ -192,36 +193,36 @@ jobs: workflows: build-for-branch: jobs: - - lint: - filters: - <<: *FILTERS_CHECK - - unit_test: - filters: - <<: *FILTERS_CHECK - - build: - filters: - <<: *FILTERS_CHECK - requires: - - unit_test - - lint - - functional_test_single: - filters: - <<: *FILTERS_CHECK - requires: - - build - - functional_test_team: - filters: - <<: *FILTERS_CHECK - requires: - - build - - delivery: - filters: - <<: *FILTERS_DELIVERY - requires: - - build +# - lint: +# filters: +# <<: *FILTERS_CHECK +# - unit_test: +# filters: +# <<: *FILTERS_CHECK +# - build: +# filters: +# <<: *FILTERS_CHECK +# requires: +# - unit_test +# - lint +# - functional_test_single: +# filters: +# <<: *FILTERS_CHECK +# requires: +# - build +# - functional_test_team: +# filters: +# <<: *FILTERS_CHECK +# requires: +# - build +# - delivery: +# filters: +# <<: *FILTERS_DELIVERY +# requires: +# - build - release: filters: <<: *FILTERS_RELEASE requires: - - build +# - build diff --git a/Makefile b/Makefile index b7b6d6eab..09e4fe190 100644 --- a/Makefile +++ b/Makefile @@ -70,14 +70,14 @@ build-circle: release: git config --global user.email "$(GIT_EMAIL)" git config --global user.name "$(GIT_NAME)" + git tag -a $(RELEASE_VERSION) -m "$(RELEASE_VERSION)" + git push $(GIT_REMOTE) $(RELEASE_VERSION) + curl --user $(GIT_USERNAME):$(GIT_PASSWORD) -X POST https://api.github.com/repos/ZupIT/ritchie-cli/pulls -H 'Content-Type: application/json' -d '{ "title": "Release $(RELEASE_VERSION) merge", "body": "Release $(RELEASE_VERSION) merge with master", "head": "release-$(RELEASE_VERSION)", "base": "master" }' gem install github_changelog_generator github_changelog_generator -u zupit -p ritchie-cli --token $(GIT_PASSWORD) --enhancement-labels feature,Feature --exclude-labels duplicate,question,invalid,wontfix git add . git commit --allow-empty -m "[ci skip] release" git push $(GIT_REMOTE) HEAD:release-$(RELEASE_VERSION) - git tag -a $(RELEASE_VERSION) -m "$(RELEASE_VERSION)" - git push $(GIT_REMOTE) $(RELEASE_VERSION) - curl --user $(GIT_USERNAME):$(GIT_PASSWORD) -X POST https://api.github.com/repos/ZupIT/ritchie-cli/pulls -H 'Content-Type: application/json' -d '{ "title": "Release $(RELEASE_VERSION) merge", "body": "Release $(RELEASE_VERSION) merge with master", "head": "release-$(RELEASE_VERSION)", "base": "master" }' delivery: ifneq "$(BUCKET)" "" diff --git a/version.sh b/version.sh index 364c67a8b..c6c6cc382 100755 --- a/version.sh +++ b/version.sh @@ -1,6 +1,7 @@ #!/bin/bash if expr "$CIRCLE_BRANCH" : 'qa' >/dev/null; then export RELEASE_VERSION="qa-${CIRCLE_BUILD_NUM}" +if expr "$CIRCLE_BRANCH" : 'fix/changelog' >/dev/null; then export RELEASE_VERSION="1.0.0.1" elif expr "$CIRCLE_BRANCH" : '^release-.*' >/dev/null; then export RELEASE_VERSION=$(echo "$CIRCLE_BRANCH"| cut -d '-' -f 2-) else echo "" fi \ No newline at end of file From bf0a9416419dfa3140457fe192298778a6a3385a Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 14:26:24 -0300 Subject: [PATCH 2/7] . --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65cdcbf86..809498c9b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -223,6 +223,6 @@ workflows: - release: filters: <<: *FILTERS_RELEASE - requires: +# requires: # - build From 3acc27dbedfb904dd863ad3c9f44bc1c95f76ddd Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 14:28:00 -0300 Subject: [PATCH 3/7] . --- bucket.sh | 11 +++++++---- credentials.sh | 5 +++-- ritchie_env.sh | 9 ++++++--- ritchie_server.sh | 9 ++++++--- version.sh | 14 +++++++++----- 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/bucket.sh b/bucket.sh index 339196d8c..4dc435a53 100755 --- a/bucket.sh +++ b/bucket.sh @@ -1,6 +1,9 @@ #!/bin/sh -if expr "$VERSION" : 'qa-*' >/dev/null; then echo "ritchie-cli-bucket234376412767550" -elif expr "$VERSION" : '^[0-9]\+' >/dev/null; then echo "ritchie-cli-bucket152849730126474" -else echo "" -fi \ No newline at end of file +if expr "$VERSION" : 'qa-*' >/dev/null; then + echo "ritchie-cli-bucket234376412767550" +elif expr "$VERSION" : '^[0-9]\+' >/dev/null; then + echo "ritchie-cli-bucket152849730126474" +else + echo "" +fi diff --git a/credentials.sh b/credentials.sh index ca236ecbe..b7ceb6324 100755 --- a/credentials.sh +++ b/credentials.sh @@ -7,5 +7,6 @@ if expr "$CIRCLE_BRANCH" : 'qa' >/dev/null; then elif expr "$CIRCLE_BRANCH" : '^release-.*' >/dev/null; then export AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID_PROD" export AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY_PROD" -else echo "" -fi \ No newline at end of file +else + echo "" +fi diff --git a/ritchie_env.sh b/ritchie_env.sh index d022d5bb5..a025289d6 100755 --- a/ritchie_env.sh +++ b/ritchie_env.sh @@ -1,6 +1,9 @@ #!/bin/sh -if expr "$VERSION" : 'qa-*' >/dev/null; then echo "qa" -elif expr "$VERSION" : '^[0-9]\+' >/dev/null; then echo "prod" -else echo "" +if expr "$VERSION" : 'qa-*' >/dev/null; then + echo "qa" +elif expr "$VERSION" : '^[0-9]\+' >/dev/null; then + echo "prod" +else + echo "" fi diff --git a/ritchie_server.sh b/ritchie_server.sh index bc9b98a25..6c4cee582 100755 --- a/ritchie_server.sh +++ b/ritchie_server.sh @@ -1,6 +1,9 @@ #!/bin/sh -if expr "$VERSION" : 'qa-*' >/dev/null; then echo "https://ritchie-server.itiaws.dev" -elif expr "$VERSION" : '^[0-9]\+' >/dev/null; then echo "https://ritchie-server.zup.io" -else echo "" +if expr "$VERSION" : 'qa-*' >/dev/null; then + echo "https://ritchie-server.itiaws.dev" +elif expr "$VERSION" : '^[0-9]\+' >/dev/null; then + echo "https://ritchie-server.zup.io" +else + echo "" fi diff --git a/version.sh b/version.sh index c6c6cc382..51e36f1d2 100755 --- a/version.sh +++ b/version.sh @@ -1,7 +1,11 @@ #!/bin/bash -if expr "$CIRCLE_BRANCH" : 'qa' >/dev/null; then export RELEASE_VERSION="qa-${CIRCLE_BUILD_NUM}" -if expr "$CIRCLE_BRANCH" : 'fix/changelog' >/dev/null; then export RELEASE_VERSION="1.0.0.1" -elif expr "$CIRCLE_BRANCH" : '^release-.*' >/dev/null; then export RELEASE_VERSION=$(echo "$CIRCLE_BRANCH"| cut -d '-' -f 2-) -else echo "" -fi \ No newline at end of file +if expr "$CIRCLE_BRANCH" : 'qa' >/dev/null; then + export RELEASE_VERSION="qa-${CIRCLE_BUILD_NUM}" +elif expr "$CIRCLE_BRANCH" : 'fix/changelog' >/dev/null; then + export RELEASE_VERSION="1.0.0.1" +elif expr "$CIRCLE_BRANCH" : '^release-.*' >/dev/null; then + export RELEASE_VERSION=$(echo "$CIRCLE_BRANCH" | cut -d '-' -f 2-) +else + echo "" +fi From 2de275fedcc6ba3caee7c42a2f5bec4acd39a9c4 Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 14:32:16 -0300 Subject: [PATCH 4/7] . --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 09e4fe190..9e31b83c7 100644 --- a/Makefile +++ b/Makefile @@ -72,9 +72,9 @@ release: git config --global user.name "$(GIT_NAME)" git tag -a $(RELEASE_VERSION) -m "$(RELEASE_VERSION)" git push $(GIT_REMOTE) $(RELEASE_VERSION) - curl --user $(GIT_USERNAME):$(GIT_PASSWORD) -X POST https://api.github.com/repos/ZupIT/ritchie-cli/pulls -H 'Content-Type: application/json' -d '{ "title": "Release $(RELEASE_VERSION) merge", "body": "Release $(RELEASE_VERSION) merge with master", "head": "release-$(RELEASE_VERSION)", "base": "master" }' + curl --user $(GIT_USERNAME):$(GIT_PASSWORD) -X POST https://api.github.com/repos/viniciusramosdefaria/ritchie-cli/pulls -H 'Content-Type: application/json' -d '{ "title": "Release $(RELEASE_VERSION) merge", "body": "Release $(RELEASE_VERSION) merge with master", "head": "release-$(RELEASE_VERSION)", "base": "master" }' gem install github_changelog_generator - github_changelog_generator -u zupit -p ritchie-cli --token $(GIT_PASSWORD) --enhancement-labels feature,Feature --exclude-labels duplicate,question,invalid,wontfix + github_changelog_generator -u viniciusramosdefaria -p ritchie-cli --token $(GIT_PASSWORD) --enhancement-labels feature,Feature --exclude-labels duplicate,question,invalid,wontfix git add . git commit --allow-empty -m "[ci skip] release" git push $(GIT_REMOTE) HEAD:release-$(RELEASE_VERSION) From 0156c82d497e3e51a43a1e9d08fcd7c425171902 Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 15:02:28 -0300 Subject: [PATCH 5/7] . --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9e31b83c7..5d24cd540 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DIST_WIN=$(DIST)/windows DIST_WIN_TEAM=$(DIST_WIN)/$(TEAM) DIST_WIN_SINGLE=$(DIST_WIN)/$(SINGLE) VERSION=$(RELEASE_VERSION) -GIT_REMOTE=https://$(GIT_USERNAME):$(GIT_PASSWORD)@github.com/ZupIT/ritchie-cli +GIT_REMOTE=https://$(GIT_USERNAME):$(GIT_PASSWORD)@github.com/viniciusramosdefaria/ritchie-cli MODULE=$(shell go list -m) DATE=$(shell date +%D_%H:%M) BUCKET=$(shell VERSION=$(VERSION) ./bucket.sh) From 23f84dce8199f34124cf52bc477fc42adb035639 Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 15:10:46 -0300 Subject: [PATCH 6/7] . --- .circleci/config.yml | 58 ++++++++++++++++++++++---------------------- Makefile | 6 ++--- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 809498c9b..e0344728d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -193,36 +193,36 @@ jobs: workflows: build-for-branch: jobs: -# - lint: -# filters: -# <<: *FILTERS_CHECK -# - unit_test: -# filters: -# <<: *FILTERS_CHECK -# - build: -# filters: -# <<: *FILTERS_CHECK -# requires: -# - unit_test -# - lint -# - functional_test_single: -# filters: -# <<: *FILTERS_CHECK -# requires: -# - build -# - functional_test_team: -# filters: -# <<: *FILTERS_CHECK -# requires: -# - build -# - delivery: -# filters: -# <<: *FILTERS_DELIVERY -# requires: -# - build + - lint: + filters: + <<: *FILTERS_CHECK + - unit_test: + filters: + <<: *FILTERS_CHECK + - build: + filters: + <<: *FILTERS_CHECK + requires: + - unit_test + - lint + - functional_test_single: + filters: + <<: *FILTERS_CHECK + requires: + - build + - functional_test_team: + filters: + <<: *FILTERS_CHECK + requires: + - build + - delivery: + filters: + <<: *FILTERS_DELIVERY + requires: + - build - release: filters: <<: *FILTERS_RELEASE -# requires: -# - build + requires: + - build diff --git a/Makefile b/Makefile index 5d24cd540..09e4fe190 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DIST_WIN=$(DIST)/windows DIST_WIN_TEAM=$(DIST_WIN)/$(TEAM) DIST_WIN_SINGLE=$(DIST_WIN)/$(SINGLE) VERSION=$(RELEASE_VERSION) -GIT_REMOTE=https://$(GIT_USERNAME):$(GIT_PASSWORD)@github.com/viniciusramosdefaria/ritchie-cli +GIT_REMOTE=https://$(GIT_USERNAME):$(GIT_PASSWORD)@github.com/ZupIT/ritchie-cli MODULE=$(shell go list -m) DATE=$(shell date +%D_%H:%M) BUCKET=$(shell VERSION=$(VERSION) ./bucket.sh) @@ -72,9 +72,9 @@ release: git config --global user.name "$(GIT_NAME)" git tag -a $(RELEASE_VERSION) -m "$(RELEASE_VERSION)" git push $(GIT_REMOTE) $(RELEASE_VERSION) - curl --user $(GIT_USERNAME):$(GIT_PASSWORD) -X POST https://api.github.com/repos/viniciusramosdefaria/ritchie-cli/pulls -H 'Content-Type: application/json' -d '{ "title": "Release $(RELEASE_VERSION) merge", "body": "Release $(RELEASE_VERSION) merge with master", "head": "release-$(RELEASE_VERSION)", "base": "master" }' + curl --user $(GIT_USERNAME):$(GIT_PASSWORD) -X POST https://api.github.com/repos/ZupIT/ritchie-cli/pulls -H 'Content-Type: application/json' -d '{ "title": "Release $(RELEASE_VERSION) merge", "body": "Release $(RELEASE_VERSION) merge with master", "head": "release-$(RELEASE_VERSION)", "base": "master" }' gem install github_changelog_generator - github_changelog_generator -u viniciusramosdefaria -p ritchie-cli --token $(GIT_PASSWORD) --enhancement-labels feature,Feature --exclude-labels duplicate,question,invalid,wontfix + github_changelog_generator -u zupit -p ritchie-cli --token $(GIT_PASSWORD) --enhancement-labels feature,Feature --exclude-labels duplicate,question,invalid,wontfix git add . git commit --allow-empty -m "[ci skip] release" git push $(GIT_REMOTE) HEAD:release-$(RELEASE_VERSION) From a81c62136cf11cbffb677b687b5304ab27429ddd Mon Sep 17 00:00:00 2001 From: Vinicius Ramos de Faria Date: Fri, 22 May 2020 15:11:16 -0300 Subject: [PATCH 7/7] cleanup --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e0344728d..d82810155 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,6 @@ references: branches: only: - /^release-.*/ - - fix/changelog filters-checks: &FILTERS_CHECK branches: