Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger nightly report #14971

Merged
merged 2 commits into from Aug 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -130,6 +130,7 @@ after_deploy:
[[ $TRAVIS_BRANCH = "develop" ]] && INSTANCE_TYPE="develop" || INSTANCE_TYPE="release";
# make sure instance is stopped. This step does not need to be chained
gcloud compute instances stop --zone $GC_ZONE "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}";
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata=NIGHTLY_TOKEN=$NIGHTLY_TOKEN && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata=TRAVIS_BRANCH=$TRAVIS_BRANCH && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-tests-script=tests/E2E/scripts/run-nightly-tests.sh && \
gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-reports-script=tests/E2E/scripts/run-nightly-reports.sh && \
Expand Down
5 changes: 5 additions & 0 deletions tests/E2E/scripts/run-nightly-reports.sh
Expand Up @@ -9,6 +9,7 @@
set -x

BRANCH=$(curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/TRAVIS_BRANCH -H "Metadata-Flavor: Google")
TOKEN=$(curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/NIGHTLY_TOKEN -H "Metadata-Flavor: Google")
CURRENT_DATE=$([ -z "$1" ] && date +%Y-%m-%d || echo $1)
NO_SHUTDOWN=$([ -z "$2" ] && echo "" || echo "yes")
DIR_PATH="/var/ps-reports/${CURRENT_DATE}"
Expand All @@ -33,6 +34,10 @@ if [ -n "$(ls ${REPORT_PATH})" ]; then

# Send file, remove directory, and shutdown if everything is ok
gsutil cp -r "${DIR_PATH}/reports" gs://prestashop-core-nightly

Progi1984 marked this conversation as resolved.
Show resolved Hide resolved
# Trigger event on nightly board
curl "https://nightly.prestashop.com/hook/add?token=${TOKEN}&filename=${REPORT_NAME}.json"

if [ -z "${NO_SHUTDOWN}" ]; then
rm -rf $DIR_PATH
shutdown -h now
Expand Down