diff --git a/.travis/ingress-controller.sh b/.travis/ingress-controller.sh index 8af37b994..45166d72c 100755 --- a/.travis/ingress-controller.sh +++ b/.travis/ingress-controller.sh @@ -14,6 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit +set -o pipefail + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/common.sh diff --git a/.travis/publish-docs.sh b/.travis/publish-docs.sh index c23b0904b..3511fbe16 100755 --- a/.travis/publish-docs.sh +++ b/.travis/publish-docs.sh @@ -14,6 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit +set -o pipefail + if ! [ -z $DEBUG ]; then set -x fi diff --git a/.travis/publish.sh b/.travis/publish.sh index deaba749c..ecfcba978 100755 --- a/.travis/publish.sh +++ b/.travis/publish.sh @@ -14,6 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit +set -o pipefail + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ "$COMPONENT" == "docs" ]; then diff --git a/build/mkdocs/Dockerfile b/build/mkdocs/Dockerfile index bb877d59e..e067e6686 100644 --- a/build/mkdocs/Dockerfile +++ b/build/mkdocs/Dockerfile @@ -15,6 +15,7 @@ FROM alpine:3.7 RUN apk update && apk add --no-cache \ + bash \ git \ git-fast-import \ openssh \ @@ -34,6 +35,6 @@ WORKDIR /docs EXPOSE 3000 -ENTRYPOINT ["mkdocs"] +COPY entrypoint.sh / -CMD ["serve", "--dev-addr=0.0.0.0:3000", "--livereload"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.travis/nginx.sh b/build/mkdocs/entrypoint.sh similarity index 54% rename from .travis/nginx.sh rename to build/mkdocs/entrypoint.sh index bb5966b25..dc87db8bc 100755 --- a/.travis/nginx.sh +++ b/build/mkdocs/entrypoint.sh @@ -1,6 +1,6 @@ -#!/usr/bin/env bash +#!/bin/bash -# Copyright 2017 The Kubernetes Authors. +# Copyright 2018 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,17 +14,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +set -o errexit +set -o pipefail -source $DIR/common.sh +CMD=$1 -IMAGE=$(make -s -C $DIR/../images/nginx image-info) - -if docker_tag_exists "kubernetes-ingress-controller/nginx" $(echo $IMAGE | jq .tag) "$ARCH"; then - echo "Image already published" - exit 0 +if [ "$CMD" == "build" ]; +then + mkdocs build + exit 0; fi -echo "building nginx-$ARCH image..." -make -C $DIR/../images/nginx sub-container-$ARCH -make -C $DIR/../images/nginx sub-push-$ARCH +mkdocs serve --dev-addr=0.0.0.0:3000 --livereload