angular/aio/scripts/build-artifacts.sh
Sergej 5886090d50 feat(docs-infra): Add opensearch description (#25479)
Enables Chrome users to search angular.io and its subdomains from the browsers navigation bar.
Not sure if compatible with Firefox yet.
The queried term in the URL is removed after closing the search-results.

PR Close #25479
2018-09-19 15:33:28 -07:00

26 lines
596 B
Bash
Executable File

#!/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
readonly PR_NUMBER=$2
readonly PR_LAST_SHA=$3
readonly deployedUrl=https://pr${PR_NUMBER}-${PR_LAST_SHA:0:7}.ngbuilds.io/
(
cd $PROJECT_ROOT/aio
# Build and store the app
yarn build
# Set deployedUrl as parameter in the opensearch description
# deployedUrl must end with /
yarn set-opensearch-url $deployedUrl
mkdir -p "`dirname $OUTPUT_FILE`"
tar --create --gzip --directory "$INPUT_DIR" --file "$OUTPUT_FILE" .
)