github.com/unigraph-dev/dgraph@v1.1.1-0.20200923154953-8b52b426f765/wiki/scripts/local.sh (about)

     1  #!/bin/bash
     2  
     3  VERSIONS_ARRAY=(
     4    'v0.9.0'
     5    'master'
     6    'v0.8.3'
     7  )
     8  
     9  joinVersions() {
    10  	versions=$(printf ",%s" "${VERSIONS_ARRAY[@]}")
    11  	echo "${versions:1}"
    12  }
    13  
    14  VERSION_STRING=$(joinVersions)
    15  
    16  run() {
    17    export CURRENT_BRANCH="master"
    18    export CURRENT_VERSION=${VERSIONS_ARRAY[0]}
    19    export VERSIONS=${VERSION_STRING}
    20    export DGRAPH_ENDPOINT=${DGRAPH_ENDPOINT:-"https://play.dgraph.io/query?latency=true"}
    21  
    22  
    23    HUGO_TITLE="Dgraph Doc - local" \
    24    VERSIONS=${VERSION_STRING} \
    25    CURRENT_BRANCH="master" \
    26  
    27    pushd $(dirname "$0")/.. > /dev/null
    28    pushd themes > /dev/null
    29  
    30    if [ ! -d "hugo-docs" ]; then
    31      git clone git@github.com:dgraph-io/hugo-docs.git
    32    else
    33      pushd hugo-docs > /dev/null
    34      git pull
    35      popd > /dev/null
    36    fi
    37    popd > /dev/null
    38  
    39  
    40    CURRENT_VERSION=${CURRENT_VERSION} hugo server -w
    41    popd > /dev/null
    42  }
    43  
    44  run