From 27bd578405a39d257835151f96b40ebab537514e Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:21:52 +0900 Subject: [PATCH 1/7] `$IS_RELEASE` is `true` or `false` `[[ "$IS_RELEASE" == "release" ]]` does never match, because `fn-is-release` outputs `true` or `false` only. --- contrib/release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/release b/contrib/release index 8a81da55f..67f77ce84 100755 --- a/contrib/release +++ b/contrib/release @@ -38,7 +38,7 @@ fn-build-dokku() { fi NAME="dokku:build" - [[ "$IS_RELEASE" == "release" ]] && NAME="dokku:build-release" + [[ "$IS_RELEASE" == "true" ]] && NAME="dokku:build-release" [[ -n "$DOKKU_VERSION" ]] || DOKKU_VERSION="master" pushd "$ROOT_DIR" >/dev/null @@ -64,7 +64,7 @@ fn-extract-package() { fi NAME="dokku:build" - [[ "$IS_RELEASE" == "release" ]] && NAME="dokku:build-release" + [[ "$IS_RELEASE" == "true" ]] && NAME="dokku:build-release" log-info "(extract-package) writing ${PACKAGE_NAME} to correct path" docker run --rm --entrypoint cat "$NAME" "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}" From be082e2fe0e8a17ad3f19db91dfd894cb7721ba9 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:24:40 +0900 Subject: [PATCH 2/7] Escaping CURRENT_VERSION to avoid too replaced like change fixed in 517314565329bc544698e63df78b96db091ccea9 --- contrib/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/release b/contrib/release index 67f77ce84..4579d77bc 100755 --- a/contrib/release +++ b/contrib/release @@ -140,7 +140,7 @@ fn-replace-version() { local CURRENT_VERSION="$1" local NEXT_VERSION="$2" local FILENAME="$3" - sed -i.bak "s/$CURRENT_VERSION/$NEXT_VERSION/g" "$FILENAME" && rm "$FILENAME.bak" + sed -i.bak "s/${CURRENT_VERSION//./\.}/$NEXT_VERSION/g" "$FILENAME" && rm "$FILENAME.bak" git add "$FILENAME" } From 607a3d88ae76e1fa0cc687634c81517da6d4bc02 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:27:35 +0900 Subject: [PATCH 3/7] CURRENT_VERSION used in fn-repo-update-history-and-commit --- contrib/release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/release b/contrib/release index 4579d77bc..480658c0c 100755 --- a/contrib/release +++ b/contrib/release @@ -200,13 +200,13 @@ fn-repo-update() { fi log-info "(release-dokku) Adding HISTORY.md, commiting and tagging" - fn-repo-update-history-and-commit "$NEXT_VERSION" + fn-repo-update-history-and-commit "$CURRENT_VERSION" "$NEXT_VERSION" git tag "v${NEXT_VERSION}" } fn-repo-update-history-and-commit() { declare desc="Updates the history file and commits the changes" - declare NEXT_VERSION="$1" + declare CURRENT_VERSION="$1" NEXT_VERSION="$2" local COMMIT_MESSAGE HISTORY HISTORY_CONTENTS HISTORY_DOCUMENTATION HISTORY_ENHANCEMENT HISTORY_BUG ISSUE_FILE pushd "$ROOT_DIR" >/dev/null From 33daa88197b0d9466e30353e1056143e4a0b3219 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:29:59 +0900 Subject: [PATCH 4/7] Add missing local --- contrib/release | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/release b/contrib/release index 480658c0c..626eb39cc 100755 --- a/contrib/release +++ b/contrib/release @@ -30,7 +30,7 @@ log-fail() { fn-build-dokku() { declare desc="Builds dokku packages within a docker container" declare IS_RELEASE="$1" DOKKU_VERSION="$2" - local NAME + local NAME GOLANG_VERSION if [[ -z "$DOKKU_VERSION" ]]; then log-error "Invalid deb file specified" @@ -207,6 +207,7 @@ fn-repo-update() { fn-repo-update-history-and-commit() { declare desc="Updates the history file and commits the changes" declare CURRENT_VERSION="$1" NEXT_VERSION="$2" + local PULL_REQUEST_ID TITLE AUTHOR TYPE CHANGELOG_TEXT local COMMIT_MESSAGE HISTORY HISTORY_CONTENTS HISTORY_DOCUMENTATION HISTORY_ENHANCEMENT HISTORY_BUG ISSUE_FILE pushd "$ROOT_DIR" >/dev/null From 4d01e677ee3cea49720cc4e110ca52d4580ae66e Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:30:33 +0900 Subject: [PATCH 5/7] Add missing `$` --- contrib/release | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/release b/contrib/release index 626eb39cc..11ad1298a 100755 --- a/contrib/release +++ b/contrib/release @@ -301,11 +301,11 @@ main() { fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" - fn-extract-package "IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb" - fn-extract-package "IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm" + fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb" + fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm" - fn-publish-package "IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb" - fn-publish-package "IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm" + fn-publish-package "$IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb" + fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm" fn-repo-push-tags "$IS_RELEASE" } From d52eac7b350e47ab6e938ba6d10591e6d23f236d Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:31:15 +0900 Subject: [PATCH 6/7] Fix a typo --- contrib/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/release b/contrib/release index 11ad1298a..d669bf4e5 100755 --- a/contrib/release +++ b/contrib/release @@ -93,7 +93,7 @@ fn-is-release() { fn-version-current() { declare desc="Retrieves the current version of dokku" - pushd "$DIR" >/dev/null + pushd "$ROOT_DIR" >/dev/null grep Version debian/control | cut -d' ' -f2 } From de338f4da5148aa4cd95545bc57db99268ddbc5e Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 30 Mar 2017 21:32:07 +0900 Subject: [PATCH 7/7] Fix a typo --- contrib/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/release b/contrib/release index d669bf4e5..30ab7b50e 100755 --- a/contrib/release +++ b/contrib/release @@ -199,7 +199,7 @@ fn-repo-update() { return fi - log-info "(release-dokku) Adding HISTORY.md, commiting and tagging" + log-info "(release-dokku) Adding HISTORY.md, committing and tagging" fn-repo-update-history-and-commit "$CURRENT_VERSION" "$NEXT_VERSION" git tag "v${NEXT_VERSION}" }