Skip to content

Commit a5c26a8

Browse files
author
Vlastimil Zeman
committed
Add script for uploading documentation
To keep it as fast/current as possible we will use rsync that to upload only changes and delete what is no longer part of documentation.
1 parent 566539e commit a5c26a8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

scripts/publish_doc.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#! /usr/bin/env bash
2+
3+
# Copy doc/html to Google Cloud bucket cprover.diffblue.com
4+
5+
set -euo pipefail
6+
7+
8+
#### Variables
9+
10+
#User-defined variables
11+
DOCS_FQDN="cprover.diffblue.com"
12+
DOCS_GS="gs://${DOCS_FQDN}"
13+
14+
# Path to generated HTML documentation
15+
DOCS_PATH="$(dirname "$(readlink -f "$0")")/../doc/html"
16+
17+
# Colors for nice output
18+
GREEN='\033[0;32m'
19+
#RED='\033[0;31m'
20+
NC='\033[0m' # No Color
21+
22+
23+
#### Deployments
24+
25+
# For develop branch
26+
if [[ "${BRANCH:-null}" == "develop" ]]; then
27+
28+
echo -e "\n${GREEN}Uploading ${DOCS_FQDN}${NC}\n"
29+
# Copy HTML docs to gcloud
30+
gsutil -m -h "Cache-Control:public,max-age=60" \
31+
rsync -r -d -c "${DOCS_PATH}" "${DOCS_GS}/"
32+
echo -e "\n${GREEN}${DOCS_FQDN} is live${NC}\n"
33+
34+
# For all other branches
35+
else
36+
echo -e "\n${GREEN}Nothing to upload in >>${BRANCH}<< branch.${NC}\n"
37+
fi

0 commit comments

Comments
 (0)