2018-05-09 18:54:13 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
2018-10-17 19:19:15 +03:00
|
|
|
readonly relativeOutputPath=$1
|
|
|
|
|
readonly prNumber=$2
|
|
|
|
|
readonly prLastSha=$3
|
2022-09-06 13:32:31 -07:00
|
|
|
readonly inputDir=../dist/bin/aio/build
|
2018-10-17 19:19:15 +03:00
|
|
|
readonly outputFile=$PROJECT_ROOT/$relativeOutputPath
|
|
|
|
|
readonly deployedUrl=https://pr${prNumber}-${prLastSha:0:7}.ngbuilds.io/
|
2018-09-20 11:21:53 +03:00
|
|
|
|
2018-05-09 18:54:13 +01:00
|
|
|
(
|
|
|
|
|
cd $PROJECT_ROOT/aio
|
|
|
|
|
|
|
|
|
|
# Build and store the app
|
2022-12-02 16:23:58 +00:00
|
|
|
yarn build-prod
|
2018-09-20 11:21:53 +03:00
|
|
|
|
2022-09-14 19:02:50 -07:00
|
|
|
# Remove write protection from the opensearch.xml in the Bazel
|
|
|
|
|
# output tree so that the url can be substituted.
|
|
|
|
|
chmod u+w ../dist/bin/aio/build/assets/opensearch.xml
|
|
|
|
|
|
2018-08-30 18:32:32 +02:00
|
|
|
# Set deployedUrl as parameter in the opensearch description
|
|
|
|
|
# deployedUrl must end with /
|
|
|
|
|
yarn set-opensearch-url $deployedUrl
|
|
|
|
|
|
2018-10-17 19:19:15 +03:00
|
|
|
mkdir -p "`dirname $outputFile`"
|
|
|
|
|
tar --create --gzip --directory "$inputDir" --file "$outputFile" .
|
2018-05-09 18:54:13 +01:00
|
|
|
)
|