From aade28172ad0ad57f448dbb5d8a7b7e686e5e214 Mon Sep 17 00:00:00 2001 From: Andres Date: Tue, 5 Sep 2017 15:18:00 +0200 Subject: [PATCH] Apply review --- .travis.yml | 7 +++++-- scripts/release.sh | 10 ---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index be9b40f..5eae9c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ services: env: global: - KUBELESS_VERSION: 0.1.0 + - REPO_DOMAIN: serverless + - REPO_NAME: serverless-kubeless - secure: "s+L8ndj0uMNwqbLvbHePHeMJw2LI8DdEdcq1vJ98hNwHOWQc2mHVB4utG9EZFkaL+RAZYduldSJqr443d2BugxrkmzhLUlM5vDks+zHeKecwTah2uuaMUXVT/y/cWDDTVp3phqSqWbHBMG6u0ImvTVWHpnkux55S3QJTHevvhdodpO6VDTsJCEB3e1d2hHxi0L9tJrFXzQRpooV8IUuODwKBJyhK4CD7rvu0D1gBgHaUNnNLrCy4YTaFl19q5NdZUtrQDC7rpSPOhFI9CBFX8GiFq6nY3XzFASwq/JtKc3K7OLIC7Wqb6JpuvFhG6S1yhBzp73pnoE9U0Bi+YMa3L+nPoh58dCB2ldNCCCMbx7R6PWq/TwYzLvgZZ7queC2kbvCTrtU6JJfmb0CxmX1fnUIpCsNeyXaPuo4Ly6WJeAID32z79CwMo9NH0uOVTLy3LTrLcEfELhBRL5+WkMvKmXUt8yN/jEIa/H38pQN5Y/AnJ0KznO8RZ2nLhi1cR+xUkxfPVZ22Wr2XkbzJDZih/mZR+5GQBfUHWgpUChK+e8dOhplk+4PZJEO6Myja7ykXBPYtL9CV/Xi+1nQqLmfhyChiES201KusJr1IrFklslzCzgrSH8Dv2yaYUTe/Ub/I3gWIhKOXY66gkpmB6MSBJUfMK3uR4/wYfCvbtBTugsY=" install: - ./scripts/install-test-environment.sh @@ -19,8 +21,9 @@ install: after_success: - | if [[ "$TRAVIS_BRANCH" == master && \ - "$TRAVIS_PULL_REQUEST" == false ]]; then - REPO_DOMAIN=serverless REPO_NAME=serverless-kubeless ./scripts/release.sh + "$TRAVIS_PULL_REQUEST" == false && \ + "$TRAVIS_REPO_SLUG" == "$REPO_DOMAIN/$REPO_NAME" ]]; then + ./scripts/release.sh fi deploy: provider: npm diff --git a/scripts/release.sh b/scripts/release.sh index 50e848e..838e599 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -17,10 +17,6 @@ function release_tag { git fetch --tags local last_tag=`curl -s https://api.github.com/repos/$REPO_DOMAIN/$REPO_NAME/tags | jq --raw-output '.[0].name'` local release_notes=`git log $last_tag..HEAD --oneline` - # Parse relase notes like an list (e.g): - # - 12345abcd Merge pull request #1 Title - # - 12345efgh commit included 1 - # - 12345hijk commit included 2 local parsed_release_notes=$(echo "$release_notes" | sed -n -e 'H;${x;s/\n/\\n - /g;s/^\\n//;p;}') parsed_release_notes=`echo "$parsed_release_notes" | sed -e '${s/ \( - [^ ]* Merge pull request\)/\1/g;}'` release=`curl -H "Authorization: token $ACCESS_TOKEN" -s --data "{ @@ -41,12 +37,6 @@ if [[ -z "$REPO_NAME" || -z "$REPO_DOMAIN" ]]; then exit 1 fi -origin=`git config --get remote.origin.url` -if [[ "$origin" != "https://github.com/$REPO_DOMAIN/$REPO_NAME" ]]; then - echo "The current origin is not the goal of the relase. Skipping..." - exit 0 -fi - repo_check=`curl -s https://api.github.com/repos/$REPO_DOMAIN/$REPO_NAME` if [[ $repo_check == *"Not Found"* ]]; then echo "Not found a Github repository for $REPO_DOMAIN/$REPO_NAME, it is not possible to publish it" > /dev/stderr