...

Text file src/github.com/datawire/ambassador/v2/scripts/doc-setup

Documentation: github.com/datawire/ambassador/v2/scripts

     1#!/usr/bin/env bash
     2
     3# Copyright 2018-2019 Datawire. All rights reserved.
     4#
     5# Licensed under the Apache License, Version 2.0 (the "License");
     6# you may not use this file except in compliance with the License.
     7# You may obtain a copy of the License at
     8#
     9#     http://www.apache.org/licenses/LICENSE-2.0
    10#
    11# Unless required by applicable law or agreed to in writing, software
    12# distributed under the License is distributed on an "AS IS" BASIS,
    13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14# See the License for the specific language governing permissions and
    15# limitations under the License
    16
    17set -o errexit
    18
    19source_dir=$(pwd)
    20
    21if [ \( $(basename $source_dir) != "ambassador" \) -a \( -d "$source_dir/ambassador/docs" \) ]; then
    22    source_dir="$source_dir/ambassador"
    23fi
    24
    25cd $(dirname $0)
    26root_dir=$(pwd)
    27
    28if [ -z "$GH_TOKEN" ]; then
    29    GH_TOKEN=$(keybase fs read /keybase/team/datawireio/secrets/github.d6e-automaton.repo-access.personal-access-token)
    30fi
    31
    32if [ -z "$WEBSITE_BRANCH" ]; then
    33    WEBSITE_BRANCH="master"
    34fi
    35
    36if [ -z "$WEBSITE_DIR" ]; then
    37    WEBSITE_DIR="/tmp/getambassador.io-$WEBSITE_BRANCH"
    38fi
    39
    40set -o nounset
    41set -o xtrace
    42
    43rm -rf "$WEBSITE_DIR"
    44
    45git clone --single-branch --branch="$WEBSITE_BRANCH" \
    46    https://d6e-automaton:${GH_TOKEN}@github.com/datawire/getambassador.io.git \
    47    "$WEBSITE_DIR"
    48
    49cd "${WEBSITE_DIR}"
    50
    51git submodule update --init # --reference="$root_dir"    
    52
    53# Swap out the "latest" info for our stuff.
    54rm -rf submodules/latest
    55mkdir submodules/latest
    56
    57(cd "$source_dir" && bash ${root_dir}/doc-sync "${WEBSITE_DIR}")
    58
    59yarn install
    60yarn run start

View as plain text