Skip to content

Commit

Permalink
Merge pull request #281 from Kong/feat/go-plugin-builder
Browse files Browse the repository at this point in the history
feat(go-plugin) push go-plugin builder docker images on official releases only
  • Loading branch information
hutchic authored May 27, 2020
2 parents 35b47d6 + f57fc36 commit 6bef046
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ DOCKER_OPENRESTY_SUFFIX=${BUILD_TOOLS_SHA}-${REQUIREMENTS_SHA}${OPENRESTY_PATCHE
DOCKER_GO_SUFFIX=${BUILD_TOOLS_SHA}-${KONG_GO_PLUGINSERVER_VERSION}${CACHE_BUSTER}
DOCKER_KONG_SUFFIX=${BUILD_TOOLS_SHA}${OPENRESTY_PATCHES}${DEBUG}-${KONG_VERSION}-${KONG_SHA}-${CACHE_BUSTER}
DOCKER_TEST_SUFFIX=${BUILD_TOOLS_SHA}-${DEBUG}-${KONG_SHA}-${CACHE_BUSTER}
OFFICIAL_RELEASE?=false

CACHE?=true

Expand Down Expand Up @@ -302,6 +303,7 @@ release-kong: test
BINTRAY_KEY=$(BINTRAY_KEY) \
PRIVATE_REPOSITORY=$(PRIVATE_REPOSITORY) \
RELEASE_DOCKER_ONLY=$(RELEASE_DOCKER_ONLY) \
OFFICIAL_RELEASE=$(OFFICIAL_RELEASE) \
./release-kong.sh
ifeq ($(BUILDX),true)
@ARCHITECTURE=arm64 \
Expand All @@ -315,6 +317,7 @@ ifeq ($(BUILDX),true)
PRIVATE_REPOSITORY=$(PRIVATE_REPOSITORY) \
DOCKER_GO_SUFFIX=$(DOCKER_GO_SUFFIX) \
RELEASE_DOCKER_ONLY=$(RELEASE_DOCKER_ONLY) \
OFFICIAL_RELEASE=$(OFFICIAL_RELEASE) \
./release-kong.sh
endif

Expand Down
16 changes: 11 additions & 5 deletions release-kong.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BINTRAY_API="https://api.bintray.com"

KONG_PACKAGE_NAME=$KONG_PACKAGE_NAME
KONG_VERSION=$KONG_VERSION
OFFICIAL_RELEASE=$OFFICIAL_RELEASE

BUILD_DIR="output"
BINTRAY_PUT_ARGS=""
Expand All @@ -21,11 +22,16 @@ if [ "$REPOSITORY_OS_NAME" == "next" ]; then
DOCKER_TAG="development"
fi

if [ "$RESTY_IMAGE_BASE" != "src" ]; then
docker tag mashape/kong-build-tools:go-plugin-tool-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}-${DOCKER_GO_SUFFIX} kong/go-plugin-tool:${KONG_VERSION}-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}
docker push kong/go-plugin-tool:${KONG_VERSION}-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}
docker tag mashape/kong-build-tools:go-plugin-tool-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}-${DOCKER_GO_SUFFIX} kong/go-plugin-tool:${DOCKER_TAG}-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}
docker push kong/go-plugin-tool:${DOCKER_TAG}-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}
if [ "$OFFICIAL_RELEASE" == "true" ]; then
if [ "$RESTY_IMAGE_BASE" == "alpine" ]; then
docker tag mashape/kong-build-tools:go-plugin-tool-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}-${DOCKER_GO_SUFFIX} kong/go-plugin-tool:${KONG_VERSION}-alpine
docker push kong/go-plugin-tool:${KONG_VERSION}-alpine
fi

if [ "$RESTY_IMAGE_TAG" == "bionic" ]; then
docker tag mashape/kong-build-tools:go-plugin-tool-${RESTY_IMAGE_BASE}-${RESTY_IMAGE_TAG}-${DOCKER_GO_SUFFIX} kong/go-plugin-tool:${KONG_VERSION}
docker push kong/go-plugin-tool:${KONG_VERSION}
fi
fi

if [ "$RESTY_IMAGE_BASE" == "ubuntu" ] || [ "$RESTY_IMAGE_BASE" == "debian" ]; then
Expand Down

0 comments on commit 6bef046

Please sign in to comment.