Merge pull request #2894 from dokku/release-error-catching
fix: bail if any step in the release process fails
This commit is contained in:
@@ -51,6 +51,7 @@ fn-build-dokku() {
|
|||||||
--build-arg GOLANG_VERSION="$GOLANG_VERSION" \
|
--build-arg GOLANG_VERSION="$GOLANG_VERSION" \
|
||||||
-f "contrib/build.Dockerfile" \
|
-f "contrib/build.Dockerfile" \
|
||||||
-t "$NAME" .
|
-t "$NAME" .
|
||||||
|
return "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn-extract-package() {
|
fn-extract-package() {
|
||||||
@@ -68,6 +69,7 @@ fn-extract-package() {
|
|||||||
|
|
||||||
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path"
|
log-info "(extract-package) writing ${PACKAGE_NAME} to correct path"
|
||||||
docker run --rm --entrypoint cat "$NAME" "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}"
|
docker run --rm --entrypoint cat "$NAME" "/data/${PACKAGE_NAME}" > "${ROOT_DIR}/${PACKAGE_NAME}"
|
||||||
|
return "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn-in-array() {
|
fn-in-array() {
|
||||||
@@ -133,6 +135,7 @@ fn-publish-package() {
|
|||||||
[[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7
|
[[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7
|
||||||
log-info "(release-dokku) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}"
|
log-info "(release-dokku) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}"
|
||||||
package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME"
|
package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME"
|
||||||
|
return "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn-replace-version() {
|
fn-replace-version() {
|
||||||
@@ -300,12 +303,19 @@ main() {
|
|||||||
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
|
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
|
||||||
|
|
||||||
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION"
|
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION"
|
||||||
|
[[ "$?" == 0 ]] || log-fail "Error building package"
|
||||||
|
|
||||||
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb"
|
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb"
|
||||||
|
[[ "$?" == 0 ]] || log-fail "Error extracting deb package"
|
||||||
|
|
||||||
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm"
|
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm"
|
||||||
|
[[ "$?" == 0 ]] || log-fail "Error extracting rpm package"
|
||||||
|
|
||||||
fn-publish-package "$IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb"
|
fn-publish-package "$IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb"
|
||||||
|
[[ "$?" == 0 ]] || log-fail "Error publishing deb package"
|
||||||
|
|
||||||
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm"
|
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm"
|
||||||
|
[[ "$?" == 0 ]] || log-fail "Error publishing deb package"
|
||||||
|
|
||||||
fn-repo-push-tags "$IS_RELEASE"
|
fn-repo-push-tags "$IS_RELEASE"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user