Skip to content

Commit

Permalink
Abort execution if there is any error running scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Aug 30, 2018
1 parent 3cb886c commit be0fdc6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .travis/ingress-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .travis/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .travis/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions build/mkdocs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
FROM alpine:3.7

RUN apk update && apk add --no-cache \
bash \
git \
git-fast-import \
openssh \
Expand All @@ -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"]
22 changes: 10 additions & 12 deletions .travis/nginx.sh → build/mkdocs/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

0 comments on commit be0fdc6

Please sign in to comment.