Skip to content

Commit

Permalink
fix(release) need to define resulting directory for some release type…
Browse files Browse the repository at this point in the history
…s on bintray (#31)
  • Loading branch information
hutchic authored Mar 21, 2019
1 parent 7cb050d commit 2ee4f14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ifeq ($(RESTY_IMAGE_BASE),alpine)
OPENSSL_EXTRA_OPTIONS=" -no-async"
endif

KONG_PACKAGE_NAME?="kong-community-edition"
KONG_PACKAGE_NAME?="kong"
KONG_CONFLICTS?="kong-enterprise-edition"
KONG_LICENSE?="ASL 2.0"
PRIVATE_REPOSITORY?=true
Expand Down
10 changes: 7 additions & 3 deletions release-kong.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ KONG_VERSION=$KONG_VERSION

BUILD_DIR="output"
BINTRAY_PUT_ARGS=""
BINTRAY_DIRECTORY="${RESTY_IMAGE_BASE}/${RESTY_IMAGE_TAG}"

if [ "$RESTY_IMAGE_BASE" == "ubuntu" ]; then
BINTRAY_DIRECTORY=""
REPOSITORY_TYPE="${REPOSITORY_TYPE:-deb}"
REPOSITORY_NAME="${REPOSITORY_NAME:-$KONG_PACKAGE_NAME-deb}"
REPOSITORY_OS_NAME="${REPOSITORY_OS_NAME:-$RESTY_IMAGE_BASE}"
Expand All @@ -32,15 +34,17 @@ elif [ "$RESTY_IMAGE_BASE" == "centos" ]; then
REPOSITORY_OS_NAME="${REPOSITORY_OS_NAME:-$RESTY_IMAGE_BASE}"
OUTPUT_FILE_SUFFIX=".el${RESTY_IMAGE_TAG}.noarch.rpm"
elif [ "$RESTY_IMAGE_BASE" == "alpine" ]; then
BINTRAY_DIRECTORY=""
REPOSITORY_TYPE="${REPOSITORY_TYPE:-generic}"
REPOSITORY_OS_NAME="${REPOSITORY_OS_NAME:-alpine}"
REPOSITORY_NAME="${REPOSITORY_NAME:-$KONG_PACKAGE_NAME-alpine-tar}"
OUTPUT_FILE_SUFFIX=".apk.tar.gz"
elif [ "$RESTY_IMAGE_BASE" == "amazonlinux" ]; then
BINTRAY_DIRECTORY="amazonlinux/amazonlinux"
REPOSITORY_TYPE="${REPOSITORY_TYPE:-rpm}"
REPOSITORY_NAME="${REPOSITORY_NAME:-$KONG_PACKAGE_NAME-rpm}"
REPOSITORY_OS_NAME="${REPOSITORY_OS_NAME:-$RESTY_IMAGE_BASE-aws}"
OUTPUT_FILE_SUFFIX=".${RESTY_IMAGE_TAG}.aws.rpm"
REPOSITORY_OS_NAME="${REPOSITORY_OS_NAME:-aws}"
OUTPUT_FILE_SUFFIX=".aws.rpm"
fi

REPOSITORY_OS_NAME=$(sed -e 's/\//-/g' <<< $REPOSITORY_OS_NAME)
Expand Down Expand Up @@ -174,7 +178,7 @@ create_package "$REPOSITORY_NAME" "$REPOSITORY_OS_NAME"

RESPONSE=$(curl -X PUT --write-out =%{http_code} -s -o - \
-u $BINTRAY_USR:$BINTRAY_KEY \
"$BINTRAY_API/content/$BINTRAY_ORG/$REPOSITORY_NAME/$REPOSITORY_OS_NAME/$KONG_VERSION/dists/$DIST_FILE$BINTRAY_PUT_ARGS" \
"$BINTRAY_API/content/$BINTRAY_ORG/$REPOSITORY_NAME/$REPOSITORY_OS_NAME/$KONG_VERSION/$BINTRAY_DIRECTORY/$DIST_FILE$BINTRAY_PUT_ARGS" \
-T $DIR/$BUILD_DIR$DIST_FILE)

print_result "$REPOSITORY_NAME artifact upload" "$RESPONSE"
Expand Down

0 comments on commit 2ee4f14

Please sign in to comment.