This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-05-14 18:59:01 -04:00
parent 3dd1699637
commit e619a1120c
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
5 changed files with 22 additions and 217 deletions

View file

@ -5,13 +5,6 @@ sudo: required
services:
- docker
# FIXME(#46924): these two commands are required to enable IPv6,
# they shouldn't exist, please revert once more official solutions appeared.
# see https://github.com/travis-ci/travis-ci/issues/8891#issuecomment-353403729
before_install:
- echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart
language: generic
notifications:
@ -22,8 +15,6 @@ notifications:
# New secure variables can be added using travis encrypt -r kubernetes/ingress-nginx --add K=V
env:
global:
- DOCKER=docker
- SKIP_SNAPSHOT=true
- GH_REF=github.com/kubernetes/ingress-nginx
- secure: LIS2XpZufWTcJ53jiRsSZy2Gi1EUJ1XmLg7z3f2ZHeMnyG2Jhk3GW4vod1FNru+PY4PWgddLdCdIl+jqOYXndFlbdAWF3/Oy5fEkYLXdYV7tdlHcPWDkqNFrfiyZ4guChN+b2Nk6FqU7o5fsZAIR7VAbgqNRF5XMo9Mhn/vhDCQRcnbXy7uq7JTrYUkqDbQoyYvT6b480GCY5gags1zp/xZfPDNZEe936o8i5IPTyiykRyNOXN/AH6kd3pR5e1xYgcvJ9KpSVPghcwFE7kJ4fOVMRhRG5ML+IyML+xD0jX43EMNoqRKZ/HS42kIMCInFbJEcxVde7DPNBZ7Y3GAqh7HO6qrE70Dn3ha6DID6zCoH2ArW39BxG4zempjn2VxYoMRGREyZszWQb++dwGoHmo5FHt6zvIrYBG0dA0H8ja9VkZkjFwtYTGHU1ooPzUfJK4O4VBayV8LqZibyZQR+GrmyQc0aagUY7J/fe4A2PJyI4DbkeZ7GX1ELj0ciDz4urQSzUc8l/T3aU3X+FuJItjgYtMLPmqcjA5uifDCtutE8Z9L2gSpanqUdvLSOozuxPho/KNl+2YlF7fXqPW3LnRf5mHD+NbOff306pvKlHJOb2Vmth+HBQ1XDzt/Cy5+sfwS3E0Vmh6UTq/NtkUXxwH10BDMF7FMVlQ4zdHQvyZ0=
- secure: rKDoy9IYYYy0fYBs4+9mwuBVq/TcxfFwMfE0ywYWhUUdgzrUYSJAwpoe/96EQ4YmESUefwC2nDNq4G3XzJKYOWf83PaIveb9Z//zmMrCQXjDuDBDLpwV3sXSh7evXiVDohJz4ogBCeMRUCMKYsyKBM9yWfa/iu+yI92dbphpK9peOKW6yBc0uspJlln4swN3GS2WT9LVuPY2Azv9U2UqrXufOPDKG/qEb/Vrn4yZ2lR/50r2k45e9nSvDoByvr10V8ubM5Zc0iP0vBuAUVRdByv6N53Q4gaBGapY6SxhIjIPC/h0rNnuT9EXp7MWaPT5FmBxLt9wnyleT9QhZJnFyaBYqFgcz/DKifYQkryY4M5dLMo/Rt3yATyAy8Y0df1TOoV2dKdqwOOwQ8bXB1wDfyrGxmQj9HY4Ffnphx3wPE1a+Sjuh+S5Epm7XJbPx5pZJqNO2hd4sTbk0Xp3gpPbihny2r/jtNwHl0wpFCfOM68RNrsVRlIwG3UhzbZvblbQ/M/mmWCdgzINjt07I2SGCJxfKG0e98Q49SKUoDoOgQTTRDqTC9IgOEDxyfAkT0Vr6BtlP88Nsgnf6kmboyigBrRAiaDQGTxn3SP6LnQI3CeopaRDYvFZe/rTwPXE9XlKoTn9FTWnAqF3MuWaLslDcDKYEh7OaYJjF01piu6g4Nc=
@ -32,49 +23,6 @@ env:
jobs:
include:
- stage: Static Check
script:
- make static-check
- stage: Lua Unit Test
script:
- make lua-test
- stage: Coverage
script:
- make cover
- stage: e2e
if: (branch = master AND env(COMPONENT) != "docs") OR (type = pull_request AND commit_message !~ /(skip-e2e)/)
before_script:
- sudo mkdir -p /home/travis/.kube/ && sudo chmod 777 /home/travis/.kube/
- curl -sSL -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -sSL -o kind https://github.com/kubernetes-sigs/kind/releases/download/0.2.1/kind-linux-amd64 && chmod +x kind && sudo mv kind /usr/local/bin/
- make e2e-test-image
script:
- test/e2e/run.sh
# split builds to avoid job timeouts
- stage: publish amd64
if: type = api AND branch = master AND repo = kubernetes/ingress-nginx AND env(COMPONENT) = "ingress-controller"
script:
- .travis/publish.sh amd64
- stage: publish arm
if: type = api AND branch = master AND repo = kubernetes/ingress-nginx AND env(COMPONENT) = "ingress-controller"
script:
- make register-qemu
- .travis/publish.sh arm
- stage: publish arm64
if: type = api AND branch = master AND repo = kubernetes/ingress-nginx AND env(COMPONENT) = "ingress-controller"
script:
- make register-qemu
- .travis/publish.sh arm64
- stage: publish ppc64le
if: type = api AND branch = master AND repo = kubernetes/ingress-nginx AND env(COMPONENT) = "ingress-controller"
script:
- make register-qemu
- .travis/publish.sh ppc64le
- stage: publish s390x
if: type = api AND branch = master AND repo = kubernetes/ingress-nginx AND env(COMPONENT) = "ingress-controller"
script:
- make register-qemu
- .travis/publish.sh s390x
- stage: Publish docs
if: type = api AND branch = master AND repo = kubernetes/ingress-nginx AND env(COMPONENT) = "docs"
script:

View file

@ -1,33 +0,0 @@
#!/usr/bin/env bash
# Copyright 2017 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.
# 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 -o errexit
set -o pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/common.sh
IMAGE=$(make -s -C $DIR/../ image-info)
if docker_tag_exists "kubernetes-ingress-controller/nginx-ingress-controller" $(echo $IMAGE | jq .tag) "$ARCH"; then
echo "Image already published"
exit 0
fi
echo "building nginx-ingress-controller-$ARCH image..."
make -C $DIR/../ sub-container-$ARCH
make -C $DIR/../ sub-push-$ARCH

View file

@ -1,45 +0,0 @@
#!/usr/bin/env bash
# Copyright 2017 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.
# 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 -o errexit
set -o pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$COMPONENT" == "docs" ]; then
echo "Skipping because we are publishing docs"
exit 0
fi
if [ $# -eq "1" ]
then
export ARCH=$1
fi
source $DIR/common.sh
echo "Login to quay.io..."
docker login --username=$QUAY_USERNAME --password=$QUAY_PASSWORD quay.io >/dev/null 2>&1
case "$COMPONENT" in
"ingress-controller")
$DIR/ingress-controller.sh
;;
*)
echo "Invalid option in environment variable COMPONENT"
exit 1
;;
esac

View file

@ -1,67 +0,0 @@
#!/usr/bin/env bash
# Copyright 2017 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.
# 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.
if ! [ -z $DEBUG ]; then
set -x
fi
set -o errexit
set -o pipefail
if [ "$TRAVIS_CI_TOKEN" == "" ];
then
echo "Environment variable TRAVIS_CI_TOKEN is missing.";
exit 1;
fi
function publish() {
body=$(cat <<EOF
{
"request": {
"branch": "master",
"message": "Publishing image for component $2 to quay.io",
"config": {
"merge_mode": "deep_merge",
"env": {
"matrix" : {
"COMPONENT": "$2"
}
}
}
}
}
EOF
)
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $1" \
--data "$body" \
https://api.travis-ci.org/repo/kubernetes%2Fingress-nginx/requests
}
case "$1" in
ingress-controller|nginx|docs)
publish $TRAVIS_CI_TOKEN $1
;;
*)
echo "Invalid publish option"
exit 1
;;
esac

View file

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Running make run-in-docker allows the execution of a target
# using a container intead of running the command locally
ifeq (run-in-docker,$(firstword $(MAKECMDGOALS)))
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(RUN_ARGS):;@:)
@ -116,21 +118,21 @@ else
$(SED_I) "s/CROSS_BUILD_//g" $(DOCKERFILE)
endif
$(DOCKER) build --no-cache --pull -t $(MULTI_ARCH_IMG):$(TAG) $(TEMP_DIR)/rootfs
@$(DOCKER) build --no-cache --pull -t $(MULTI_ARCH_IMG):$(TAG) $(TEMP_DIR)/rootfs
ifeq ($(ARCH), amd64)
# This is for maintaining backward compatibility
$(DOCKER) tag $(MULTI_ARCH_IMG):$(TAG) $(IMAGE):$(TAG)
@$(DOCKER) tag $(MULTI_ARCH_IMG):$(TAG) $(IMAGE):$(TAG)
endif
.PHONY: clean-container
clean-container:
$(DOCKER) rmi -f $(MULTI_ARCH_IMG):$(TAG) || true
@$(DOCKER) rmi -f $(MULTI_ARCH_IMG):$(TAG) || true
.PHONY: register-qemu
register-qemu:
# Register /usr/bin/qemu-ARCH-static as the handler for binaries in multiple platforms
$(DOCKER) run --rm --privileged multiarch/qemu-user-static:register --reset
@$(DOCKER) run --rm --privileged multiarch/qemu-user-static:register --reset
.PHONY: push
push: .push-$(ARCH)
@ -144,11 +146,11 @@ endif
.PHONY: build
build:
build/build.sh
@build/build.sh
.PHONY: build-plugin
build-plugin:
build/build-plugin.sh
@build/build-plugin.sh
.PHONY: clean
clean:
@ -156,15 +158,15 @@ clean:
.PHONY: static-check
static-check:
build/static-check.sh
@build/static-check.sh
.PHONY: test
test:
build/test.sh
@build/test.sh
.PHONY: lua-test
lua-test:
build/test-lua.sh
@build/test-lua.sh
.PHONY: e2e-test
e2e-test:
@ -197,17 +199,17 @@ e2e-test-image: e2e-test-binary
.PHONY: e2e-test-binary
e2e-test-binary:
ginkgo build ./test/e2e
@ginkgo build ./test/e2e
.PHONY: cover
cover:
build/cover.sh
@build/cover.sh
echo "Uploading coverage results..."
curl -s https://codecov.io/bash | bash
@curl -s https://codecov.io/bash | bash
.PHONY: vet
vet:
go vet $(shell go list ${PKG}/... | grep -v vendor)
@go vet $(shell go list ${PKG}/internal/... | grep -v vendor)
.PHONY: release
release: all-container all-push
@ -215,7 +217,7 @@ release: all-container all-push
.PHONY: check_dead_links
check_dead_links:
docker run -t \
@docker run -t \
-v $$PWD:/tmp aledbf/awesome_bot:0.1 \
--allow-dupe \
--allow-redirect $(shell find $$PWD -mindepth 1 -name "*.md" -printf '%P\n' | grep -v vendor | grep -v Changelog.md)
@ -227,21 +229,21 @@ dep-ensure:
.PHONY: dev-env
dev-env:
build/dev-env.sh
@build/dev-env.sh
.PHONY: live-docs
live-docs:
docker build --pull -t ingress-nginx/mkdocs build/mkdocs
docker run --rm -it -p 3000:3000 -v ${PWD}:/docs ingress-nginx/mkdocs
@docker build --pull -t ingress-nginx/mkdocs build/mkdocs
@docker run --rm -it -p 3000:3000 -v ${PWD}:/docs ingress-nginx/mkdocs
.PHONY: build-docs
build-docs:
docker build --pull -t ingress-nginx/mkdocs build/mkdocs
docker run --rm -v ${PWD}:/docs ingress-nginx/mkdocs build
@docker build --pull -t ingress-nginx/mkdocs build/mkdocs
@docker run --rm -v ${PWD}:/docs ingress-nginx/mkdocs build
.PHONY: misspell
misspell:
go get github.com/client9/misspell/cmd/misspell
@go get github.com/client9/misspell/cmd/misspell
misspell \
-locale US \
-error \