Skip to content

Commit

Permalink
misc(ci) setup travis-ci (#9)
Browse files Browse the repository at this point in the history
* misc(ci) setup travis-ci

* misc(ci) setup travis-ci

* misc(ci) setup travis-ci

* feat(rhel) add rhel tests to travis-ci

* fix(rhel) add hostname dependency to test image
  • Loading branch information
hutchic authored Nov 26, 2018
1 parent 8f60bbe commit 1cb4274
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
dist: xenial
sudo: false
language: minimal

env:
- RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=trusty
- RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=xenial
- RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=6
- RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=7
- RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=6
- RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=7
- RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=latest

before_install:
- sudo make setup_tests
- sudo iptables -P FORWARD ACCEPT
- git clone [email protected]:Kong/kong.git ../kong

install:
- make package-kong

script:
- make test
25 changes: 25 additions & 0 deletions test/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM registry.access.redhat.com/rhel7/rhel

ARG KONG_VERSION="0.0.0"
ARG KONG_PACKAGE_NAME="kong-community-edition"
ARG RESTY_IMAGE_TAG="7"
ARG REDHAT_USERNAME
ARG REDHAT_PASSWORD

RUN subscription-manager register --username ${REDHAT_USERNAME} --password ${REDHAT_PASSWORD} --auto-attach && \
yum-config-manager --enable 'rhel-*-server-optional-rpms'

RUN yum -y install perl openssl hostname

COPY output/${KONG_PACKAGE_NAME}-${KONG_VERSION}.rhel${RESTY_IMAGE_TAG}.noarch.rpm /kong.rpm

RUN rpm -i kong.rpm

COPY test/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 8000 8443 8001 8444

STOPSIGNAL SIGTERM

CMD ["kong", "docker-start"]
4 changes: 4 additions & 0 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ elif [ "$RESTY_IMAGE_BASE" == "ubuntu" ]; then
DOCKER_FILE="Dockerfile.ubuntu"
elif [ "$RESTY_IMAGE_BASE" == "centos" ]; then
DOCKER_FILE="Dockerfile.centos"
elif [ "$RESTY_IMAGE_BASE" == "rhel" ]; then
DOCKER_FILE="Dockerfile.rhel"
else
echo "Unrecognized base image $RESTY_IMAGE_BASE"
exit 1
Expand All @@ -17,6 +19,8 @@ microk8s.docker build \
--build-arg RESTY_IMAGE_TAG=$RESTY_IMAGE_TAG \
--build-arg KONG_VERSION=$KONG_VERSION \
--build-arg KONG_PACKAGE_NAME=$KONG_PACKAGE_NAME \
--build-arg REDHAT_USERNAME=$REDHAT_USERNAME \
--build-arg REDHAT_PASSWORD=$REDHAT_PASSWORD \
-f test/$DOCKER_FILE \
-t localhost:32000/kong .

Expand Down

0 comments on commit 1cb4274

Please sign in to comment.