2018-09-19 11:49:43 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-09-27 09:11:20 +02:00
|
|
|
#source gskey.sh
|
2018-09-27 02:54:56 +02:00
|
|
|
|
2018-09-27 09:11:20 +02:00
|
|
|
#sudo gsutil version -l
|
2018-09-27 02:54:56 +02:00
|
|
|
|
2018-09-27 09:11:20 +02:00
|
|
|
#harbor_logs_bucket="harbor-ci-logs"
|
2018-09-27 02:54:56 +02:00
|
|
|
# GC credentials
|
2018-09-27 09:11:20 +02:00
|
|
|
#keyfile="/home/travis/harbor-ci-logs.key"
|
|
|
|
#botofile="/home/travis/.boto"
|
|
|
|
#echo -en $GS_PRIVATE_KEY > $keyfile
|
|
|
|
#sudo chmod 400 $keyfile
|
|
|
|
#echo "[Credentials]" >> $botofile
|
|
|
|
#echo "gs_service_key_file = $keyfile" >> $botofile
|
|
|
|
#echo "gs_service_client_id = $GS_CLIENT_EMAIL" >> $botofile
|
|
|
|
#echo "[GSUtil]" >> $botofile
|
|
|
|
#echo "content_language = en" >> $botofile
|
|
|
|
#echo "default_project_id = $GS_PROJECT_ID" >> $botofile
|
2018-09-27 02:54:56 +02:00
|
|
|
|
|
|
|
# GS util
|
2018-09-27 09:11:20 +02:00
|
|
|
#function uploader {
|
|
|
|
# sudo gsutil cp $1 gs://$2/$1
|
|
|
|
# sudo gsutil -D setacl public-read gs://$2/$1 &> /dev/null
|
|
|
|
#}
|
2018-09-27 02:54:56 +02:00
|
|
|
|
2018-09-27 09:11:20 +02:00
|
|
|
#set +e
|
2018-09-19 11:49:43 +02:00
|
|
|
|
|
|
|
docker ps
|
|
|
|
# run db auth api cases
|
|
|
|
if [ "$1" = 'DB' ]; then
|
|
|
|
pybot -v ip:$2 -v HARBOR_PASSWORD:Harbor12345 /home/travis/gopath/src/github.com/goharbor/harbor/tests/robot-cases/Group0-BAT/API_DB.robot
|
|
|
|
fi
|
|
|
|
# run ldap api cases
|
|
|
|
if [ "$1" = 'LDAP' ]; then
|
|
|
|
pybot -v ip:$2 -v HARBOR_PASSWORD:Harbor12345 /home/travis/gopath/src/github.com/goharbor/harbor/tests/robot-cases/Group0-BAT/API_LDAP.robot
|
|
|
|
fi
|
2018-09-27 02:54:56 +02:00
|
|
|
|
|
|
|
## --------------------------------------------- Upload Harbor CI Logs -------------------------------------------
|
2018-09-27 09:11:20 +02:00
|
|
|
#outfile="integration_logs_$TRAVIS_BUILD_NUMBER_$TRAVIS_COMMIT.tar.gz"
|
|
|
|
#sudo tar -zcvf $outfile output.xml log.html /var/log/harbor/*
|
|
|
|
#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
|
2018-09-27 02:54:56 +02:00
|
|
|
|