2018-05-09 13:54:13 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
source "`dirname $0`/../../scripts/ci/env.sh" print
|
|
|
|
|
|
|
|
readonly INPUT_DIR=dist/
|
|
|
|
readonly OUTPUT_FILE=$PROJECT_ROOT/$1
|
2018-08-30 12:32:32 -04:00
|
|
|
readonly PR_NUMBER=$2
|
|
|
|
readonly PR_LAST_SHA=$3
|
|
|
|
readonly deployedUrl=https://pr${PR_NUMBER}-${PR_LAST_SHA:0:7}.ngbuilds.io/
|
2018-09-20 04:21:53 -04:00
|
|
|
|
2018-05-09 13:54:13 -04:00
|
|
|
(
|
|
|
|
cd $PROJECT_ROOT/aio
|
|
|
|
|
|
|
|
# Build and store the app
|
|
|
|
yarn build
|
2018-09-20 04:21:53 -04:00
|
|
|
|
2018-08-30 12:32:32 -04:00
|
|
|
# Set deployedUrl as parameter in the opensearch description
|
|
|
|
# deployedUrl must end with /
|
|
|
|
yarn set-opensearch-url $deployedUrl
|
|
|
|
|
2018-05-09 13:54:13 -04:00
|
|
|
mkdir -p "`dirname $OUTPUT_FILE`"
|
|
|
|
tar --create --gzip --directory "$INPUT_DIR" --file "$OUTPUT_FILE" .
|
|
|
|
)
|