-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds the first e2e test which create a gameserver and connect to it
this also add the gcloud builder step to test it in a special e2e cluster
- Loading branch information
Cyril TOVENA
committed
Aug 1, 2018
1 parent
20b0144
commit e4f921d
Showing
15 changed files
with
528 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ tmp | |
build/local-includes/* | ||
!build/local-includes/README.md | ||
/release | ||
debug.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM gcr.io/cloud-builders/gcloud-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y wget psmisc make python jq zip && \ | ||
apt-get clean | ||
|
||
# install go | ||
WORKDIR /usr/local | ||
ENV GO_VERSION=1.10.3 | ||
ENV GOPATH /go | ||
RUN wget -q https://redirector.gvt1.com/edgedl/go/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir ${GOPATH} | ||
|
||
ENV PATH /usr/local/go/bin:/go/bin:$PATH | ||
|
||
# install kubectl without gcloud as we want the last version | ||
ENV KUBECTL_VER 1.11.0 | ||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VER}/bin/linux/amd64/kubectl && \ | ||
chmod go+rx ./kubectl && \ | ||
mv ./kubectl /usr/local/bin/kubectl | ||
|
||
# install Helm package manager | ||
ENV HELM_VER 2.9.1 | ||
ENV HELM_URL https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VER}-linux-amd64.tar.gz | ||
RUN curl -L ${HELM_URL} > /tmp/helm.tar.gz \ | ||
&& tar -zxvf /tmp/helm.tar.gz -C /tmp \ | ||
&& mv /tmp/linux-amd64/helm /usr/local/bin/helm \ | ||
&& chmod go+rx /usr/local/bin/helm \ | ||
&& rm /tmp/helm.tar.gz && rm -rf /tmp/linux-amd64 | ||
|
||
# set up Consul. | ||
ENV CONSUL_VERSION=1.2.1 | ||
ENV HASHICORP_RELEASES=https://releases.hashicorp.com | ||
RUN mkdir -p /tmp/build && \ | ||
wget ${HASHICORP_RELEASES}/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip \ | ||
-P /tmp/build/ && \ | ||
unzip -d /usr/local/bin/ /tmp/build/consul_${CONSUL_VERSION}_linux_amd64.zip && \ | ||
cd /tmp && \ | ||
rm -rf /tmp/build && \ | ||
chmod go+rx /usr/local/bin/consul && \ | ||
# tiny smoke test to ensure the binary we downloaded runs | ||
consul version | ||
|
||
# make sure we keep the path to go | ||
RUN echo "export PATH=/usr/local/go/bin:/go/bin/:\$PATH" >> /root/.bashrc | ||
# scripts | ||
COPY *.sh /root/ | ||
RUN chmod +x /root/*.sh | ||
|
||
WORKDIR /go | ||
|
||
ENTRYPOINT [ "/root/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2017 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
echo "installing current release" | ||
DOCKER_RUN= make install | ||
echo "starting e2e test" | ||
DOCKER_RUN= make test-e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2017 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
set -e | ||
|
||
export SHELL="/bin/bash" | ||
export KUBECONFIG="/root/.kube/config" | ||
mkdir -p /go/src/agones.dev/agones/ /root/.kube/ | ||
cp -r /workspace/. /go/src/agones.dev/agones/ | ||
cd /go/src/agones.dev/agones/build | ||
if [ "$1" = 'local' ] | ||
then | ||
gcloud auth login | ||
fi | ||
gcloud container clusters get-credentials e2e-test-cluster \ | ||
--zone=us-west1-c --project=agones-images | ||
kubectl port-forward statefulset/consul-consul 8500:8500 & | ||
echo "Waiting consul port-forward to launch on 8500..." | ||
timeout 60 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' 127.0.0.1 8500 | ||
echo "consul port-forward launched. Starting e2e tests..." | ||
consul lock -child-exit-code=true -timeout 5m -try 5m -verbose LockE2E /root/e2e.sh | ||
killall -q kubectl | ||
|
Oops, something went wrong.