forked from pingcap/tidb-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry pick pr 1102: add e2e scripts and simplify e2e jenkins file (p…
…ingcap#1198) * add e2e scripts and simplify e2e jenkins file (pingcap#1102) * e2e scripts * fix * fix * fix * copy and modify * check e2e status * Update hack/run-e2e.sh Co-Authored-By: Tennix <tennix@users.noreply.github.com> * Update hack/run-e2e.sh Co-Authored-By: Tennix <tennix@users.noreply.github.com> * simplify * Update hack/e2e.sh Co-Authored-By: Tennix <tennix@users.noreply.github.com> * retry on non-fatal errors * fix * fix * fix image repalces * fix * wait for the secret for sa is created * vendor kubectl binary * setup go * fix
- Loading branch information
Showing
9 changed files
with
278 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
required_providers { | ||
google = "~> 2.16" | ||
google-beta = "~> 2.16" | ||
external = "~> 1.2" | ||
helm = "~> 0.10" | ||
null = "~> 2.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# E2E entrypoint script. | ||
# | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd) | ||
cd $ROOT | ||
|
||
function usage() { | ||
cat <<'EOF' | ||
This script is entrypoint to run e2e tests. | ||
Usage: hack/e2e.sh [-h] -- [extra test args] | ||
-h show this message and exit | ||
Environments: | ||
DOCKER_REGISTRY image docker registry | ||
IMAGE_TAG image tag | ||
SKIP_BUILD skip building binaries | ||
SKIP_IMAGE_BUILD skip build and push images | ||
EOF | ||
|
||
} | ||
|
||
while getopts "h?" opt; do | ||
case "$opt" in | ||
h|\?) | ||
usage | ||
exit 0 | ||
;; | ||
esac | ||
done | ||
|
||
DOCKER_REGISTRY=${DOCKER_REGISTRY:-localhost:5000} | ||
IMAGE_TAG=${IMAGE_TAG:-latest} | ||
SKIP_BUILD=${SKIP_BUILD:-} | ||
SKIP_IMAGE_BUILD=${SKIP_IMAGE_BUILD:-} | ||
|
||
echo "DOCKER_REGISTRY: $DOCKER_REGISTRY" | ||
echo "IMAGE_TAG: $IMAGE_TAG" | ||
echo "SKIP_BUILD: $SKIP_BUILD" | ||
echo "SKIP_IMAGE_BUILD: $SKIP_IMAGE_BUILD" | ||
|
||
if [ -n "$SKIP_BUILD" ]; then | ||
echo "info: skip building images" | ||
export NO_BUILD=y | ||
fi | ||
|
||
if [ -n "$SKIP_IMAGE_BUILD" ]; then | ||
echo "info: skip building and pushing images" | ||
else | ||
DOCKER_REGISTRY=$DOCKER_REGISTRY IMAGE_TAG=$IMAGE_TAG make docker-push | ||
DOCKER_REGISTRY=$DOCKER_REGISTRY IMAGE_TAG=$IMAGE_TAG make e2e-docker-push | ||
fi | ||
|
||
# in kind cluster, we must use local registry | ||
# TODO: find a better way | ||
export TIDB_OPERATOR_IMAGE=localhost:5000/pingcap/tidb-operator:${IMAGE_TAG} | ||
export E2E_IMAGE=localhost:5000/pingcap/tidb-operator-e2e:${IMAGE_TAG} | ||
export TEST_APISERVER_IMAGE=localhost:5000/pingcap/test-apiserver:${IMAGE_TAG} | ||
|
||
hack/run-e2e.sh "$@" |
Oops, something went wrong.