commit
bb776c43a8
9 changed files with 71 additions and 72 deletions
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -52,24 +52,24 @@ function build_for_arch(){
|
|||
arch=$2
|
||||
extension=$3
|
||||
|
||||
env GOOS=${os} GOARCH=${arch} go build \
|
||||
${GOBUILD_FLAGS} \
|
||||
env GOOS="${os}" GOARCH="${arch}" go build \
|
||||
"${GOBUILD_FLAGS}" \
|
||||
-ldflags "-s -w \
|
||||
-X ${PKG}/version.RELEASE=${TAG} \
|
||||
-X ${PKG}/version.COMMIT=${GIT_COMMIT} \
|
||||
-X ${PKG}/version.REPO=${REPO_INFO}" \
|
||||
-o ${release}/kubectl-ingress_nginx${extension} ${PKG}/cmd/plugin
|
||||
-o "${release}/kubectl-ingress_nginx${extension}" "${PKG}/cmd/plugin"
|
||||
|
||||
tar -C ${release} -zcvf ${release}/kubectl-ingress_nginx-${os}-${arch}.tar.gz kubectl-ingress_nginx${extension}
|
||||
rm ${release}/kubectl-ingress_nginx${extension}
|
||||
hash=`sha256sum ${release}/kubectl-ingress_nginx-${os}-${arch}.tar.gz | awk '{ print $1 }'`
|
||||
sed -i "s/%%%shasum_${os}_${arch}%%%/${hash}/g" ${release}/ingress-nginx.yaml
|
||||
tar -C "${release}" -zcvf "${release}/kubectl-ingress_nginx-${os}-${arch}.tar.gz" "kubectl-ingress_nginx${extension}"
|
||||
rm "${release}/kubectl-ingress_nginx${extension}"
|
||||
hash=$(sha256sum "${release}/kubectl-ingress_nginx-${os}-${arch}.tar.gz" | awk '{ print $1 }')
|
||||
sed -i "s/%%%shasum_${os}_${arch}%%%/${hash}/g" "${release}/ingress-nginx.yaml"
|
||||
}
|
||||
|
||||
rm -rf ${release}
|
||||
mkdir ${release}
|
||||
rm -rf "${release}"
|
||||
mkdir "${release}"
|
||||
|
||||
cp cmd/plugin/ingress-nginx.yaml.tmpl ${release}/ingress-nginx.yaml
|
||||
cp cmd/plugin/ingress-nginx.yaml.tmpl "${release}/ingress-nginx.yaml"
|
||||
|
||||
sed -i "s/%%%tag%%%/${TAG}/g" ${release}/ingress-nginx.yaml
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -46,17 +46,17 @@ fi
|
|||
export CGO_ENABLED=0
|
||||
|
||||
go build \
|
||||
${GOBUILD_FLAGS} \
|
||||
"${GOBUILD_FLAGS}" \
|
||||
-ldflags "-s -w \
|
||||
-X ${PKG}/version.RELEASE=${TAG} \
|
||||
-X ${PKG}/version.COMMIT=${GIT_COMMIT} \
|
||||
-X ${PKG}/version.REPO=${REPO_INFO}" \
|
||||
-o bin/${ARCH}/nginx-ingress-controller ${PKG}/cmd/nginx
|
||||
-o "bin/${ARCH}/nginx-ingress-controller" "${PKG}/cmd/nginx"
|
||||
|
||||
go build \
|
||||
${GOBUILD_FLAGS} \
|
||||
"${GOBUILD_FLAGS}" \
|
||||
-ldflags "-s -w \
|
||||
-X ${PKG}/version.RELEASE=${TAG} \
|
||||
-X ${PKG}/version.COMMIT=${GIT_COMMIT} \
|
||||
-X ${PKG}/version.REPO=${REPO_INFO}" \
|
||||
-o bin/${ARCH}/dbg ${PKG}/cmd/dbg
|
||||
-o "bin/${ARCH}/dbg" "${PKG}/cmd/dbg"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -28,9 +28,9 @@ if [ -z "${PKG}" ]; then
|
|||
fi
|
||||
|
||||
rm -rf coverage.txt
|
||||
for d in `go list ${PKG}/... | grep -v vendor | grep -v '/test/e2e' | grep -v images`; do
|
||||
for d in $(go list "${PKG}/..." | grep -v vendor | grep -v '/test/e2e' | grep -v images); do
|
||||
t=$(date +%s);
|
||||
go test -coverprofile=cover.out -covermode=atomic $d || exit 1;
|
||||
go test -coverprofile=cover.out -covermode=atomic "$d" || exit 1;
|
||||
echo "Coverage test $d took $(($(date +%s)-$t)) seconds";
|
||||
if [ -f cover.out ]; then
|
||||
cat cover.out >> coverage.txt;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -35,7 +35,7 @@ export REGISTRY=${REGISTRY:-ingress-controller}
|
|||
DEV_IMAGE=${REGISTRY}/nginx-ingress-controller:${TAG}
|
||||
|
||||
if [ -z "${SKIP_MINIKUBE_START}" ]; then
|
||||
test $(minikube status | grep Running | wc -l) -ge 2 && $(minikube status | grep -q 'Correctly Configured') || minikube start \
|
||||
test "$(minikube status | grep -c Running) -ge 2 && $(minikube status | grep -q 'Correctly Configured')" || minikube start \
|
||||
--extra-config=kubelet.sync-frequency=1s \
|
||||
--extra-config=apiserver.authorization-mode=RBAC
|
||||
|
||||
|
@ -52,15 +52,15 @@ for tool in kubectl kustomize; do
|
|||
$tool version || brew install $tool
|
||||
done
|
||||
|
||||
if ! kubectl get namespace $NAMESPACE; then
|
||||
kubectl create namespace $NAMESPACE
|
||||
if ! kubectl get namespace "${NAMESPACE}"; then
|
||||
kubectl create namespace "${NAMESPACE}"
|
||||
fi
|
||||
|
||||
ROOT=./deploy/minikube
|
||||
|
||||
pushd $ROOT
|
||||
kustomize edit set namespace $NAMESPACE
|
||||
kustomize edit set image quay.io/kubernetes-ingress-controller/nginx-ingress-controller=${DEV_IMAGE}
|
||||
kustomize edit set namespace "${NAMESPACE}"
|
||||
kustomize edit set image "quay.io/kubernetes-ingress-controller/nginx-ingress-controller=${DEV_IMAGE}"
|
||||
popd
|
||||
|
||||
echo "[dev-env] deploying NGINX Ingress controller in namespace $NAMESPACE"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -24,7 +24,7 @@ set -o pipefail
|
|||
|
||||
E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v06262019-ecce3fd7b
|
||||
|
||||
DOCKER_OPTS=${DOCKER_OPTS:-""}
|
||||
DOCKER_OPTS=${DOCKER_OPTS:-}
|
||||
|
||||
FLAGS=$@
|
||||
|
||||
|
@ -33,7 +33,7 @@ ARCH=$(go env GOARCH)
|
|||
|
||||
MINIKUBE_PATH=${HOME}/.minikube
|
||||
MINIKUBE_VOLUME="-v ${MINIKUBE_PATH}:${MINIKUBE_PATH}"
|
||||
if [ ! -d ${MINIKUBE_PATH} ]; then
|
||||
if [ ! -d "${MINIKUBE_PATH}" ]; then
|
||||
echo "Minikube directory not found! Volume will be excluded from docker build."
|
||||
MINIKUBE_VOLUME=""
|
||||
fi
|
||||
|
@ -42,11 +42,12 @@ docker run \
|
|||
--tty \
|
||||
--rm \
|
||||
${DOCKER_OPTS} \
|
||||
-v ${HOME}/.kube:/${HOME}/.kube \
|
||||
-v ${PWD}:/go/src/${PKG} \
|
||||
-v ${PWD}/.gocache:${HOME}/.cache/go-build \
|
||||
-v ${PWD}/bin/${ARCH}:/go/bin/linux_${ARCH} \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v "${HOME}/.kube:${HOME}/.kube" \
|
||||
-v "${PWD}:/go/src/${PKG}" \
|
||||
-v "${PWD}/.gocache:${HOME}/.cache/go-build" \
|
||||
-v "${PWD}/bin/${ARCH}:/go/bin/linux_${ARCH}" \
|
||||
-v "/var/run/docker.sock:/var/run/docker.sock" \
|
||||
${MINIKUBE_VOLUME} \
|
||||
-w /go/src/${PKG} \
|
||||
${E2E_IMAGE} ${FLAGS}
|
||||
-w "/go/src/${PKG}" \
|
||||
-u $(id -u ${USER}):$(id -g ${USER}) \
|
||||
${E2E_IMAGE} /bin/bash -c "${FLAGS}"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z "$DEBUG" ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -47,7 +47,7 @@ fi
|
|||
function cleanup {
|
||||
echo -e "${BGREEN}Stoping kubectl proxy${NC}"
|
||||
rm -rf "${SSL_VOLUME}"
|
||||
kill $proxy_pid
|
||||
kill "$proxy_pid"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
|
@ -78,7 +78,7 @@ sleep 1
|
|||
|
||||
echo -e "\n${BGREEN}kubectl proxy PID: ${BGREEN}$proxy_pid${NC}"
|
||||
|
||||
until $(curl --output /dev/null -fsSL http://localhost:8001/); do
|
||||
until curl --output /dev/null -fsSL http://localhost:8001/; do
|
||||
echo -e "${RED}waiting for kubectl proxy${NC}"
|
||||
sleep 5
|
||||
done
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -25,8 +25,6 @@ set -o pipefail
|
|||
|
||||
resty \
|
||||
-I ./rootfs/etc/nginx/lua \
|
||||
-I /usr/local/lib/lua \
|
||||
-I /usr/lib/lua-platform-path/lua/5.1 \
|
||||
--shdict "configuration_data 5M" \
|
||||
--shdict "certificate_data 16M" \
|
||||
--shdict "balancer_ewma 1M" \
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -29,4 +29,4 @@ if [ -z "${PKG}" ]; then
|
|||
fi
|
||||
|
||||
go test -v -race -tags "cgo" \
|
||||
$(go list ${PKG}/... | grep -v vendor | grep -v '/test/e2e' | grep -v images | grep -v "docs/examples")
|
||||
$(go list "${PKG}/..." | grep -v vendor | grep -v '/test/e2e' | grep -v images | grep -v "docs/examples")
|
||||
|
|
Loading…
Reference in a new issue