Skip to content

Commit 195ffe7

Browse files
authored
create gcp upload script for interactive visualizers (#375)
* create gcp upload script * upload to subdirectory in the gcp bucket based on package version
1 parent 24bf2a7 commit 195ffe7

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

interactive-visualizers/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "interactive-visualizers",
3-
"version": "0.0.0",
3+
"version": "0.0.1",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
@@ -48,4 +48,4 @@
4848
"typescript": "~4.0.2",
4949
"whatwg-fetch": "^3.4.1"
5050
}
51-
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2019 Google LLC. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# =============================================================================
15+
16+
set -e
17+
18+
# get package directory
19+
PACKAGE_DIR="dist/interactive-visualizers/*"
20+
# host url
21+
PACKAGE_HOST="interactive_visualizer"
22+
23+
rm -rf dist/
24+
yarn prod-build
25+
26+
PACKAGE_VERSION=`node -p "require('./package.json').version"`
27+
echo 'current version: ' $PACKAGE_VERSION
28+
# remove the pre-built addon tarball if it already exist
29+
if [ "$1" = "for-publish" ]; then
30+
echo 'copying ...'
31+
gsutil -m cp $PACKAGE_DIR gs://$PACKAGE_HOST/$PACKAGE_VERSION
32+
fi

0 commit comments

Comments
 (0)