minikube/hack/jenkins/upload_integration_report.sh

53 lines
1.9 KiB
Bash
Raw Normal View History

#!/bin/bash
# Copyright 2021 The Kubernetes Authors All rights reserved.
#
# 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.
# This script uploads the test reports to the GCS bucket
# The script expects the following env variables:
# UPSTREAM_JOB: the name of the job that needs logs uploaded
# FILE_NAME: the name of the file upload to
2021-05-03 20:21:56 +00:00
set -x
2023-10-13 17:52:21 +00:00
JOB_GCS_BUCKET="minikube-builds/logs/${MINIKUBE_LOCATION}/${ROOT_JOB_ID}/${UPSTREAM_JOB}_integration"
2021-03-15 18:19:49 +00:00
ARTIFACTS=artifacts/test_reports
2021-05-03 20:21:56 +00:00
ls -l $ARTIFACTS
2021-03-23 17:44:52 +00:00
TEST_OUT="$ARTIFACTS/out.txt"
2021-03-18 17:45:43 +00:00
echo ">> uploading ${TEST_OUT} to gs://${JOB_GCS_BUCKET}.txt"
gsutil -qm cp "${TEST_OUT}" "gs://${JOB_GCS_BUCKET}.txt" || true
2021-03-23 17:44:52 +00:00
JSON_OUT="$ARTIFACTS/out.json"
echo ">> uploading ${JSON_OUT}"
gsutil -qm cp "${JSON_OUT}" "gs://${JOB_GCS_BUCKET}.json" || true
2021-03-23 17:44:52 +00:00
HTML_OUT="$ARTIFACTS/out.html"
echo ">> uploading ${HTML_OUT}"
gsutil -qm cp "${HTML_OUT}" "gs://${JOB_GCS_BUCKET}.html" || true
2023-08-03 21:37:25 +00:00
SUMMARY_OUT="$ARTIFACTS/summary.json"
echo ">> uploading ${SUMMARY_OUT}"
gsutil -qm cp "${SUMMARY_OUT}" "gs://${JOB_GCS_BUCKET}_summary.json" || true
2023-08-03 21:37:25 +00:00
if [ "$MINIKUBE_LOCATION" = "master" ]
then
./installers/check_install_gopogh.sh
2023-10-13 17:52:21 +00:00
gopogh -in "${JSON_OUT}" -out_html "${HTML_OUT}" -name "${UPSTREAM_JOB}" -pr "${MINIKUBE_LOCATION}" -repo github.com/kubernetes/minikube/ -details "${COMMIT}:$(date +%Y-%m-%d):${ROOT_JOB_ID}" -db_backend "${GOPOGH_DB_BACKEND}" -db_host "${GOPOGH_DB_HOST}" -db_path "${GOPOGH_DB_PATH}" -use_cloudsql -use_iam_auth
2023-08-03 21:37:25 +00:00
fi