Skip to content

Commit

Permalink
fix(release): unify the docker release logic to one spot (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchic authored Aug 26, 2022
1 parent 5859c95 commit e7a5fba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ ifeq ($(BUILDX),true)
PACKAGE_TYPE=$(PACKAGE_TYPE) \
./release-kong.sh
endif
ifeq ($(RELEASE_DOCKER),true)
make push_docker_images
endif

test: build-test-container
ifneq ($(RESTY_IMAGE_BASE),src)
Expand Down
28 changes: 2 additions & 26 deletions release-kong.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ esac

DIST_FILE="$KONG_PACKAGE_NAME-$KONG_VERSION$OUTPUT_FILE_SUFFIX"


function push_docker_images() {
docker tag \
"localhost:5000/kong-$RESTY_IMAGE_BASE-$RESTY_IMAGE_TAG" \
"$DOCKER_REPOSITORY:$ARCHITECTURE-$KONG_VERSION"

echo "FROM $DOCKER_REPOSITORY:$ARCHITECTURE-$KONG_VERSION" | docker build \
${DOCKER_LABELS} \
-t "$DOCKER_REPOSITORY:$ARCHITECTURE-$KONG_VERSION" -
docker push "$DOCKER_REPOSITORY:$ARCHITECTURE-$KONG_VERSION"

docker manifest create \
-a "$DOCKER_REPOSITORY:$KONG_VERSION-$RESTY_IMAGE_BASE" \
"$DOCKER_REPOSITORY:$ARCHITECTURE-$KONG_VERSION"
docker manifest push "$DOCKER_REPOSITORY:$KONG_VERSION-$RESTY_IMAGE_BASE"
}


function push_package() {
# src has no dist-version
local dist_version="--dist-version $RESTY_IMAGE_TAG"
Expand Down Expand Up @@ -121,14 +103,8 @@ function push_package() {
}


# only push docker images for alpine builds
# this is for "release per commit" builds
if [[ "$RELEASE_DOCKER" == "true" ]]; then
push_docker_images

if [[ "$RELEASE_DOCKER_ONLY" == "true" ]]; then
exit 0
fi
if [[ "$RELEASE_DOCKER_ONLY" == "true" ]]; then
exit 0
fi


Expand Down

0 comments on commit e7a5fba

Please sign in to comment.