From 64d46d0bf57859a3a6d3865bd289177d46e32d96 Mon Sep 17 00:00:00 2001 From: Robin Reyes Date: Thu, 19 Mar 2020 01:47:15 -0700 Subject: [PATCH 1/2] Create separate script for fetching Unity minigame binaries --- scripts/app_start.sh | 14 ++------------ scripts/unity_fetch.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 scripts/unity_fetch.sh diff --git a/scripts/app_start.sh b/scripts/app_start.sh index 8411238..9672200 100755 --- a/scripts/app_start.sh +++ b/scripts/app_start.sh @@ -1,17 +1,7 @@ #!/usr/bin/env bash -# Get minigames release version -release=$(head -n 1 release.txt) -binary_location="https://github.com/ubclaunchpad/ubcsim2/releases/download/${release}/ubcsim2-minigames${release}.zip" - -# Get Unity binaries from release on GitHub -rm -rf temp -rm -rf public/unity -mkdir temp -mkdir public/unity -wget ${binary_location} -O temp/unity.zip -unzip temp/unity.zip -d temp -cp -r temp/ubcsim2-minigames${release}/* public/unity/ +# Fetch Unity minigame binaries +scripts/unity_fetch.sh # Start app react-scripts start \ No newline at end of file diff --git a/scripts/unity_fetch.sh b/scripts/unity_fetch.sh new file mode 100644 index 0000000..5eb9eab --- /dev/null +++ b/scripts/unity_fetch.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Get minigames release version +release=$(head -n 1 release.txt) +binary_location="https://github.com/ubclaunchpad/ubcsim2/releases/download/${release}/ubcsim2-minigames${release}.zip" + +# Get Unity binaries from release on GitHub +rm -rf temp +rm -rf public/unity +mkdir temp +mkdir public/unity +wget ${binary_location} -O temp/unity.zip +unzip temp/unity.zip -d temp +cp -r temp/ubcsim2-minigames${release}/* public/unity/ \ No newline at end of file From 52e1232eb7ea0e82eba354379157344e5707fe09 Mon Sep 17 00:00:00 2001 From: Robin Reyes Date: Thu, 19 Mar 2020 01:48:46 -0700 Subject: [PATCH 2/2] Create npm script for app deployment --- package.json | 2 +- scripts/app_deploy.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 scripts/app_deploy.sh diff --git a/package.json b/package.json index e16f875..94b29bb 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "react-scripts test", "start": "scripts/app_start.sh", "build": "react-scripts build", - "deploy": "gh-pages -d build" + "deploy": "scripts/app_deploy.sh" }, "author": "UBC Launch Pad", "license": "ISC", diff --git a/scripts/app_deploy.sh b/scripts/app_deploy.sh new file mode 100644 index 0000000..d25e51c --- /dev/null +++ b/scripts/app_deploy.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Fetch Unity minigame binaries +scripts/unity_fetch.sh + +# Deploy app +gh-pages -d build \ No newline at end of file