Skip to content

Commit

Permalink
chore(build): cleanup file size history report
Browse files Browse the repository at this point in the history
affects: @buildit/gravity-ui-web

refactory scripts to share common code and exclude files from history report
  • Loading branch information
Travis CI committed May 20, 2019
1 parent 22aaac7 commit 4fd4922
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
10 changes: 7 additions & 3 deletions packages/gravity-ui-web/filesizehistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,22 @@

function getData(chartData) {
var seriesRow = [];
var files = [];
seriesRow.push('Date');
for (var property in chartData.reports[0].files) {
seriesRow.push(property);
if (!property.endsWith("map") && !property.endsWith("json")) {
seriesRow.push(property);
files.push(property);
}
};
var rows = [];
rows.push(seriesRow);

chartData.reports.forEach(element => {
var dataRow = [];
dataRow.push(element.date);
for (const value of Object.values(element.files)) {
dataRow.push(value.size);
for (const value of files) {
dataRow.push(element.files[value].size);
};
rows.push(dataRow);
});
Expand Down
7 changes: 1 addition & 6 deletions scripts/cdn_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ fi

if [ ! -z "$cdnChanges" ]
then
allVersions=`git tag --list --sort=-committerdate | grep -E '^(gravity-ui-web-)?v[0-9]*.[0-9]*.[0-9]*'`

# First tag in the list will be the latest one, but may be prefixed (e.g. "gravity-ui-web-v1.2.3")
version=`echo $allVersions | cut -d" " -f1`
# be sure we get only the version part and discard any prefix
version=`expr $version : '.*\(v[0-9].*\)'`
source ./scripts/get_latest_version.sh

mkdir -p ${cdnCurrentVersionGravityDir}/${version}
cp packages/gravity-ui-web/dist/ui-lib/* ${cdnCurrentVersionGravityDir}/${version}
Expand Down
7 changes: 7 additions & 0 deletions scripts/get_latest_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

allVersions=`git tag --list --sort=-committerdate | grep -E '^(gravity-ui-web-)?v[0-9]*.[0-9]*.[0-9]*'`
# First tag in the list will be the latest one, but may be prefixed (e.g. "gravity-ui-web-v1.2.3")
version=`echo $allVersions | cut -d" " -f1`
# be sure we get only the version part and discard any prefix
version=`expr $version : '.*\(v[0-9].*\)'`
6 changes: 1 addition & 5 deletions scripts/track_file_sizes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ if [ ! -z "$TRAVIS_COMMIT" ] && [[ "develop" == "$TRAVIS_BRANCH" || "master" ==
then
file-size-report -p $distDir -o $currentSizesFile

allVersions=`git tag --list --sort=-committerdate | grep -E '^(gravity-ui-web-)?v[0-9]*.[0-9]*.[0-9]*'`
# First tag in the list will be the latest one, but may be prefixed (e.g. "gravity-ui-web-v1.2.3")
version=`echo $allVersions | cut -d" " -f1`
# be sure we get only the version part and discard any prefix
version=`expr $version : '.*\(v[0-9].*\)'`
source ./scripts/get_latest_version.sh

~/.local/bin/aws s3 cp s3://${CDN_BUCKET}/$cdnGravityDir/$historyFileName $historyFile --region=${PROD_BUCKET_REGION} --quiet

Expand Down

0 comments on commit 4fd4922

Please sign in to comment.