blob: 50068f21f380cd8cd0dfedc302ba68cba6077bc8 [file] [log] [blame]
Lalit Magantib36a6902018-11-27 17:55:31 +00001#!/bin/bash
2set -e
3
4echo ""
5echo "Downloading latest copy of test data"
6echo ""
7LATEST_ZIP="$(gsutil ls gs://perfetto | sort | grep test-data | tail -n 1)"
8gsutil cp $LATEST_ZIP /tmp/latest-test-data.zip
9
10echo ""
11echo "Extracting test data to temp folder"
12echo ""
13unzip /tmp/latest-test-data.zip -d /tmp/latest-test-data
14
15echo ""
16echo "Copying trace to temp folder"
17echo ""
18cp $1 /tmp/latest-test-data
19
20echo ""
21echo "Zipping file back up"
22echo ""
23NEW_TEST_DATA="test-data-$(date +%Y%m%d).zip"
Lalit Magantia3c3e262018-11-29 18:37:04 +000024CWD="$(pwd)"
25cd /tmp/latest-test-data
26zip -r /tmp/$NEW_TEST_DATA *
27cd $CWD
Lalit Magantib36a6902018-11-27 17:55:31 +000028
29echo ""
30echo "Uploading file to Google Cloud"
31echo ""
32gsutil cp /tmp/$NEW_TEST_DATA gs://perfetto/$NEW_TEST_DATA
33
34echo ""
35echo "Setting file to world readable"
36echo ""
37gsutil acl ch -u AllUsers:R gs://perfetto/$NEW_TEST_DATA
38
39echo ""
40echo "sha1sum of file $NEW_TEST_DATA is"
41echo $(sha1sum /tmp/$NEW_TEST_DATA)
42
43echo ""
44echo "Cleaning up leftover files"
45echo ""
46rm -r /tmp/latest-test-data
47rm /tmp/latest-test-data.zip
48rm /tmp/$NEW_TEST_DATA
49
50echo ""
51echo "All done! Please update tools/install-build-deps"
52echo "with the new file name and sha1sum"
53echo ""