Skip to content

Commit

Permalink
chore(ci) add the ability to use the Kong CI setup from external repo…
Browse files Browse the repository at this point in the history
…sitories (Kong#5013)

* chore(ci) most setup ci tasks to a Make task

* chore(debug) debug why this call is failing

* chore(debug) remove the debug

* chore(ci) this symlink is not necessary
  • Loading branch information
hutchic authored Sep 9, 2019
1 parent aeb9594 commit 273ff8c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
#---------

DEPS_HASH=$(cat .ci/setup_env.sh .travis.yml | md5sum | awk '{ print $1 }')
DOWNLOAD_ROOT=${DOWNLOAD_ROOT:=/download-root}
BUILD_TOOLS_DOWNLOAD=$DOWNLOAD_ROOT/openresty-build-tools

KONG_NGINX_MODULE_BRANCH=${KONG_NGINX_MODULE_BRANCH:=master}
OPENRESTY_PATCHES_BRANCH=${OPENRESTY_PATCHES_BRANCH:=master}

git clone https://github.com/Kong/openresty-build-tools.git $DOWNLOAD_ROOT/openresty-build-tools
export PATH=$BUILD_TOOLS_DOWNLOAD:$PATH

#--------
# Install
#--------
INSTALL_CACHE=${INSTALL_CACHE:=/install-cache}
INSTALL_ROOT=$INSTALL_CACHE/$DEPS_HASH

kong-ngx-build \
Expand Down
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@ addons:

env:
global:
- LUAROCKS=3.1.3
- OPENSSL=1.1.1c
- OPENRESTY=1.15.8.1
- DOWNLOAD_ROOT=$HOME/download-root
- INSTALL_CACHE=$HOME/install-cache
- OPENRESTY_PATCHES_BRANCH=master
- KONG_NGINX_MODULE_BRANCH=master
- DOWNLOAD_ROOT=$HOME/download-root
- KONG_TEST_PG_DATABASE=travis
- KONG_TEST_PG_USER=postgres
- JOBS=2
Expand All @@ -48,12 +43,12 @@ env:
- TEST_SUITE=pdk

install:
- make setup-ci
- source .ci/setup_env.sh
- make dev

cache:
apt: true
pip: true
directories:
- $INSTALL_CACHE
- $HOME/.ccm/repository
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ RESTY_OPENSSL_VERSION ?= `grep RESTY_OPENSSL_VERSION $(KONG_SOURCE_LOCATION)/.re
RESTY_PCRE_VERSION ?= `grep RESTY_PCRE_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'`
KONG_BUILD_TOOLS ?= '2.0.1'
KONG_VERSION ?= `cat $(KONG_SOURCE_LOCATION)/kong-*.rockspec | grep tag | awk '{print $$3}' | sed 's/"//g'`
OPENRESTY_PATCHES_BRANCH ?= master
KONG_NGINX_MODULE_BRANCH ?= master

.PHONY: setup-ci
setup-ci:
OPENRESTY=$(RESTY_VERSION) \
LUAROCKS=$(RESTY_LUAROCKS_VERSION) \
OPENSSL=$(RESTY_OPENSSL_VERSION) \
OPENRESTY_PATCHES_BRANCH=$($OPENRESTY_PATCHES_BRANCH) \
KONG_NGINX_MODULE_BRANCH=$(KONG_NGINX_MODULE_BRANCH) \
.ci/setup_env.sh

setup-kong-build-tools:
-rm -rf kong-build-tools; \
Expand Down

0 comments on commit 273ff8c

Please sign in to comment.