mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 17:28:46 +03:00
d9b35ad1ab
* Add docs publish instructions * Make publish script fail if Bazel fails
45 lines
843 B
Bash
Executable File
45 lines
843 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Needs to be run with the `aws` command available and
|
|
# after running `aws-google-auth`.
|
|
|
|
set -euo pipefail
|
|
export AWS_PROFILE=sts
|
|
|
|
SCRIPT_DIR=$(dirname "$0")
|
|
cd $SCRIPT_DIR
|
|
|
|
STAGE=false
|
|
|
|
for arg in "$@"
|
|
do
|
|
if [ "$arg" = "--stage" ]; then
|
|
STAGE=true
|
|
fi
|
|
done
|
|
|
|
if [ $STAGE == true ]; then
|
|
BUCKET=s3://docs-daml-com-staging/
|
|
else
|
|
BUCKET=s3://docs-daml-com/
|
|
fi
|
|
|
|
bazel build //docs
|
|
tar -zxf ../../bazel-genfiles/docs/html.tar.gz
|
|
|
|
aws s3 sync \
|
|
html \
|
|
$BUCKET \
|
|
--delete \
|
|
--acl public-read \
|
|
--exclude .doctrees/** \
|
|
--exclude .buildinfo
|
|
|
|
rm -r html
|
|
|
|
if [ $STAGE == false ]; then
|
|
aws cloudfront create-invalidation --distribution-id E1U753I56ERH55 --paths '/*'
|
|
fi
|