Skip to content

Commit

Permalink
Merge pull request #272 from Kong/fix/next-issues
Browse files Browse the repository at this point in the history
fix(packaging) fix some build packaging errors
  • Loading branch information
hutchic authored May 13, 2020
2 parents 1b782c5 + 29fdb44 commit 34be64b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,4 @@ pipeline {
}
}
}
}
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ else
--build-arg RESTY_IMAGE_BASE=$(RESTY_IMAGE_BASE) \
--build-arg DOCKER_REPOSITORY=$(DOCKER_REPOSITORY) \
--build-arg DOCKER_BASE_SUFFIX=$(DOCKER_BASE_SUFFIX) \
--build-arg DEBUG=$(DEBUG) \
-t $(DOCKER_REPOSITORY):go-plugin-tool-$(RESTY_IMAGE_BASE)-$(RESTY_IMAGE_TAG)-$(DOCKER_GO_SUFFIX) . )
endif

Expand Down Expand Up @@ -337,6 +336,7 @@ ifneq ($(RESTY_IMAGE_BASE),src)
KONG_ADMIN_URI="http://$(TEST_HOST):$(TEST_ADMIN_PORT)" \
KONG_PROXY_URI="http://$(TEST_HOST):$(TEST_PROXY_PORT)" \
TEST_COMPOSE_PATH=$(TEST_COMPOSE_PATH) \
KONG_GO_PLUGINSERVER_VERSION=$(KONG_GO_PLUGINSERVER_VERSION) \
DOCKER_GO_BUILDER=$(DOCKER_REPOSITORY):go-plugin-tool-$(RESTY_IMAGE_BASE)-$(RESTY_IMAGE_TAG)-$(DOCKER_GO_SUFFIX) \
./test/run_tests.sh && make update-cache-images
endif
Expand Down
2 changes: 1 addition & 1 deletion fpm-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd /tmp/build
FPM_PARAMS=""
if [ "$RESTY_IMAGE_BASE" == "ubuntu" ] || [ "$RESTY_IMAGE_BASE" == "debian" ]; then
PACKAGE_TYPE="deb"
FPM_PARAMS="-d libpcre3 -d perl -d zlibc"
FPM_PARAMS="-d libpcre3 -d perl -d zlibc -d zlib1g-dev"
OUTPUT_FILE_SUFFIX=".${RESTY_IMAGE_TAG}"
elif [ "$RESTY_IMAGE_BASE" == "centos" ]; then
PACKAGE_TYPE="rpm"
Expand Down
1 change: 1 addition & 0 deletions test/tests/01-package/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set -x

# openresty
docker run ${USE_TTY} --user=root --rm ${KONG_TEST_IMAGE_NAME} /bin/sh -c "/usr/local/openresty/bin/openresty -v 2>&1 | grep -q ${RESTY_VERSION}"
Expand Down
10 changes: 0 additions & 10 deletions test/tests/03-go-plugins/Dockerfile.build_plugin

This file was deleted.

27 changes: 10 additions & 17 deletions test/tests/03-go-plugins/up.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@

# clone plugins
git clone https://github.com/Kong/go-plugins

pushd go-plugins

echo "Go builder image: $DOCKER_GO_BUILDER"
rm -rf *.so

for src in *.go; do
echo "compile $src"
docker run --rm -v $(pwd):/plugins $DOCKER_GO_BUILDER build $src
done

popd

# cp -v *.so /usr/local/kong
# cd ..
# rm -rf go-plugins

# docker build --build-arg DOCKER_GO_BUILDER=$DOCKER_GO_BUILDER \
# -f Dockerfile.build_plugin -t go-plugin-builder .
# docker run --name go-plugin-builder-container go-plugin-builder
USE_TTY="-t"
test -t 1 && USE_TTY="-it"

# docker cp go-plugin-builder-container:/go-plugins/go-hello.so .
GO_PDK_VERSION=$(curl -fsL https://raw.githubusercontent.com/Kong/go-pluginserver/$KONG_GO_PLUGINSERVER_VERSION/go.mod | grep go-pdk | awk -F" " '{print $2}')
docker run -d --name go-plugin --rm -v $(pwd):/plugins $DOCKER_GO_BUILDER tail -f /dev/null
docker exec $USE_TTY go-plugin go mod edit -replace github.com/Kong/go-pdk=github.com/Kong/go-pdk@$GO_PDK_VERSION
docker exec $USE_TTY go-plugin make
docker stop go-plugin

# docker rm -f go-plugin-builder-container
# rm -rf go-plugins
popd

echo $KONG_TEST_IMAGE_NAME
docker build --build-arg KONG_TEST_IMAGE_NAME=$KONG_TEST_IMAGE_NAME \
Expand Down
3 changes: 2 additions & 1 deletion test/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ wait_kong() {
while [[ "$(docker-compose -f $TEST_COMPOSE_PATH ps | grep healthy | wc -l | tr -d ' ')" != "2" ]]; do
msg_yellow "Waiting for Kong to be ready..."
docker-compose -f $TEST_COMPOSE_PATH ps
sleep 5
docker-compose -f $TEST_COMPOSE_PATH logs
sleep 15
done
}

0 comments on commit 34be64b

Please sign in to comment.