Commit 3e558def authored by Tim Leers's avatar Tim Leers Committed by Geoff Simmons

inline commands

parent ec13f4d6
stages: stages:
- test
- build - build
- e2e - e2e
- test
test: test:
image: golang:1.11.6 image: golang:1.11.6
...@@ -70,6 +70,7 @@ build:controller: ...@@ -70,6 +70,7 @@ build:controller:
- docker push $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/$IMAGE:latest - docker push $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/$IMAGE:latest
integration: integration:
needs: ["build:controller"]
stage: e2e stage: e2e
image: docker:19.03.8 image: docker:19.03.8
services: services:
...@@ -97,6 +98,7 @@ integration: ...@@ -97,6 +98,7 @@ integration:
# using varnish image with latest tag due to performance. if we are changing this image a lot, we need to improve this as can lead to pulling the incorrect image # using varnish image with latest tag due to performance. if we are changing this image a lot, we need to improve this as can lead to pulling the incorrect image
- docker pull $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/varnish:latest - docker pull $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/varnish:latest
- docker tag $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/controller:$CI_COMMIT_SHA varnish-ingress/controller - docker tag $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/controller:$CI_COMMIT_SHA varnish-ingress/controller
- docker tag $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/varnish:latest varnish-ingress/ingress - docker tag $CI_REGISTRY/timleers/k8s-ingress/varnish-ingress/varnish:latest varnish-ingress/varnish
- kind load docker-image varnish-ingress/varnish
- kind load docker-image varnish-ingress/controller
- test/e2e.sh - test/e2e.sh
...@@ -4,13 +4,6 @@ function killforward { ...@@ -4,13 +4,6 @@ function killforward {
kill $KUBEPID kill $KUBEPID
} }
failureCode() {
local code=${2:-500}
local status=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null localhost:${LOCALPORT})
[[ $status == ${code} ]] || [[ $status == 000 ]]
}
LOCALPORT=${LOCALPORT:-8888} LOCALPORT=${LOCALPORT:-8888}
kubectl wait --timeout=2m pod -l app=varnish-ingress,example!=cli-args --for=delete kubectl wait --timeout=2m pod -l app=varnish-ingress,example!=cli-args --for=delete
...@@ -22,11 +15,5 @@ kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null & ...@@ -22,11 +15,5 @@ kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null &
KUBEPID=$! KUBEPID=$!
trap killforward EXIT trap killforward EXIT
for ((n = 0; n < 20; n++)); do sleep 1
if [[ failureCode ]] ; then
sleep 0.5
fi
break
done
varnishtest ${TESTOPTS} -Dlocalport=${LOCALPORT} cafe_cli-args.vtc varnishtest ${TESTOPTS} -Dlocalport=${LOCALPORT} cafe_cli-args.vtc
...@@ -4,12 +4,6 @@ function killforward { ...@@ -4,12 +4,6 @@ function killforward {
kill $KUBEPID kill $KUBEPID
} }
failureCode() {
local code=${2:-500}
local status=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null localhost:${LOCALPORT})
[[ $status == ${code} ]] || [[ $status == 000 ]]
}
LOCALPORT=${LOCALPORT:-8888} LOCALPORT=${LOCALPORT:-8888}
kubectl wait --timeout=2m pod -l app=varnish-ingress,example!=proxy --for=delete kubectl wait --timeout=2m pod -l app=varnish-ingress,example!=proxy --for=delete
...@@ -21,11 +15,5 @@ kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null & ...@@ -21,11 +15,5 @@ kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null &
KUBEPID=$! KUBEPID=$!
trap killforward EXIT trap killforward EXIT
for ((n = 0; n < 20; n++)); do sleep 1
if [[ failureCode ]] ; then
sleep 0.5
fi
break
done
varnishtest ${TESTOPTS} -Dlocalport=${LOCALPORT} cafe_proxy.vtc varnishtest ${TESTOPTS} -Dlocalport=${LOCALPORT} cafe_proxy.vtc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment