angular/aio/scripts/build-artifacts.sh
Paul Gschwendtner eb43ed25eb build: do not use --config=release when building AIO for development (#48329)
When building AIO using `yarn build` the `--config=release` is added.
This was done as part of the Bazel migration to make sure the footer
shows a Git revision via Bazel stamping.

This does not provide enough benefits, compared to the downside of
reduced caching. Bazel will discard the analysis cache when the stamp
configuration changes.

This may happen easily when you work in framework where
`--config=release` is not used. Then when starting work in AIO: the
config changes and the cache is discarded. This may even mean that
existing framework package build artifacts may be discarded when an
AIO local build is started.

Co-authored-by: Joey Perrott <josephperrott@gmail.com>

PR Close #48329
2022-12-02 09:47:42 -08:00

28 lines
772 B
Bash
Executable file

#!/usr/bin/env bash
set -eu -o pipefail
readonly relativeOutputPath=$1
readonly prNumber=$2
readonly prLastSha=$3
readonly inputDir=../dist/bin/aio/build
readonly outputFile=$PROJECT_ROOT/$relativeOutputPath
readonly deployedUrl=https://pr${prNumber}-${prLastSha:0:7}.ngbuilds.io/
(
cd $PROJECT_ROOT/aio
# Build and store the app
yarn build-prod
# 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
# Set deployedUrl as parameter in the opensearch description
# deployedUrl must end with /
yarn set-opensearch-url $deployedUrl
mkdir -p "`dirname $outputFile`"
tar --create --gzip --directory "$inputDir" --file "$outputFile" .
)