mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 06:28:06 +01:00
Add step to upload travis logs into GCR
Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
7116baabed
commit
d86692d61c
@ -44,8 +44,6 @@ apt:
|
||||
- google-chrome-stable
|
||||
- google-chrome-beta
|
||||
before_install:
|
||||
#- openssl aes-256-cbc -K $encrypted_ed2284a9ecc3_key -iv $encrypted_ed2284a9ecc3_iv
|
||||
# -in gskey.sh.enc -out ./gskey.sh -d
|
||||
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname
|
||||
-s`-`uname -m` > docker-compose
|
||||
- chmod +x docker-compose
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
#source gskey.sh
|
||||
|
||||
#sudo gsutil version -l
|
||||
sudo gsutil version -l
|
||||
|
||||
#harbor_logs_bucket="harbor-ci-logs"
|
||||
harbor_logs_bucket="harbor-ci-logs"
|
||||
# GC credentials
|
||||
#keyfile="/home/travis/harbor-ci-logs.key"
|
||||
#botofile="/home/travis/.boto"
|
||||
@ -18,12 +18,12 @@
|
||||
#echo "default_project_id = $GS_PROJECT_ID" >> $botofile
|
||||
|
||||
# GS util
|
||||
#function uploader {
|
||||
# sudo gsutil cp $1 gs://$2/$1
|
||||
# sudo gsutil -D setacl public-read gs://$2/$1 &> /dev/null
|
||||
#}
|
||||
function uploader {
|
||||
sudo gsutil cp $1 gs://$2/$1
|
||||
sudo gsutil acl ch -u AllUsers:R gs://$2/$1 &> /dev/null
|
||||
}
|
||||
|
||||
#set +e
|
||||
set +e
|
||||
|
||||
docker ps
|
||||
# run db auth api cases
|
||||
@ -35,16 +35,20 @@ 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
|
||||
|
||||
## --------------------------------------------- Upload Harbor CI Logs -------------------------------------------
|
||||
#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
|
||||
rc=$?
|
||||
echo $rc
|
||||
|
||||
## --------------------------------------------- Upload Harbor CI Logs -------------------------------------------
|
||||
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
|
||||
|
||||
exit $rc
|
Loading…
Reference in New Issue
Block a user