Decrepate tests from drone ci (#5919)

This commit is to remove tests from drone CI server, and leave drone
as the build system only for harbor. Harbor system admin will remove
the webhook from harbor repo, then any pull request will not trigger
drone job.

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
Yan 2018-09-19 16:54:15 +08:00 committed by GitHub
parent 3e76eaf1b3
commit e77a116e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,8 +23,8 @@ if [[ $DRONE_REPO != "goharbor/harbor" ]]; then
exit 1
fi
# It won't package an new harbor build against tag, just pick up a build which passed CI and push to release.
if [[ $DRONE_BUILD_EVENT == "tag" ]]; then
echo "We do nothing against 'tag'."
if [[ $DRONE_BUILD_EVENT == "tag" || $DRONE_BUILD_EVENT == "pull_request" ]]; then
echo "We do nothing against 'tag' and 'pull request'."
exit 0
fi
@ -127,7 +127,6 @@ function publishImage {
docker images
}
## --------------------------------------------- Run Test Case ---------------------------------------------
echo "--------------------------------------------------"
echo "Running CI for $DRONE_BUILD_EVENT on $DRONE_BRANCH"
echo "--------------------------------------------------"
@ -144,43 +143,6 @@ if [[ $DRONE_BRANCH == "master" || $DRONE_BRANCH == *"refs/tags"* || $DRONE_BRAN
fi
fi
##
# Any Event(pull_request or push) on any branch will trigger test run.
##
if (echo $buildinfo | grep -q "\[Specific CI="); then
buildtype=$(echo $buildinfo | grep "\[Specific CI=")
testsuite=$(echo $buildtype | awk -F"\[Specific CI=" '{sub(/\].*/,"",$2);print $2}')
pybot -v HARBOR_ADMIN:$HARBOR_ADMIN -v HARBOR_PASSWORD:$HARBOR_PASSWORD -v ip:$container_ip -v notaryServerEndpoint:$container_ip:4443 --removekeywords TAG:secret --suite $testsuite tests/robot-cases
elif (echo $buildinfo | grep -q "\[Full CI\]"); then
pybot -v HARBOR_ADMIN:$HARBOR_ADMIN -v HARBOR_PASSWORD:$HARBOR_PASSWORD -v ip:$container_ip -v notaryServerEndpoint:$container_ip:4443 --removekeywords TAG:secret --exclude skip tests/robot-cases
elif (echo $buildinfo | grep -q "\[Skip CI\]"); then
echo "Skip CI."
elif (echo $buildinfo | grep -q "\[Upload Build\]"); then
package_offline_installer
pybot -v HARBOR_ADMIN:$HARBOR_ADMIN -v HARBOR_PASSWORD:$HARBOR_PASSWORD -v ip:$container_ip -v notaryServerEndpoint:$container_ip:4443 --removekeywords TAG:secret --include BAT tests/robot-cases/Group0-BAT
else
# default mode is BAT.
pybot -v HARBOR_ADMIN:$HARBOR_ADMIN -v HARBOR_PASSWORD:$HARBOR_PASSWORD -v ip:$container_ip -v notaryServerEndpoint:$container_ip:4443 --removekeywords TAG:secret --include BAT tests/robot-cases/Group0-BAT
fi
# rc is used to identify test run pass or fail.
rc="$?"
echo $rc
## --------------------------------------------- Upload Harbor CI Logs -------------------------------------------
timestamp=$(date +%s)
outfile="integration_logs_"$DRONE_BUILD_NUMBER"_"$DRONE_COMMIT".tar.gz"
tar -zcvf $outfile output.xml log.html *.png package.list *container-logs.zip *.log /var/log/harbor/* /data/config/* /data/job_logs/*
if [ -f "$outfile" ]; then
uploader $outfile $harbor_logs_bucket
echo "----------------------------------------------"
echo "Download test logs:"
echo "https://storage.googleapis.com/harbor-ci-logs/$outfile"
echo "----------------------------------------------"
else
echo "No log output file to upload"
fi
## --------------------------------------------- Upload Harbor Bundle File ---------------------------------------
#
# Build storage structure:
@ -226,4 +188,3 @@ if [ -f "$keyfile" ]; then
rm -f $keyfile
fi
exit $rc