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/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 364c67a8b..51e36f1d2 100755 --- a/version.sh +++ b/version.sh @@ -1,6 +1,11 @@ #!/bin/bash -if expr "$CIRCLE_BRANCH" : 'qa' >/dev/null; then export RELEASE_VERSION="qa-${CIRCLE_BUILD_NUM}" -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