Skip to content

Commit

Permalink
Move Versions array to build.sh and other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawan Rawal committed May 1, 2017
1 parent 1c66ee1 commit 5f7eb75
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
3 changes: 3 additions & 0 deletions docker/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ MAINTAINER Dgraph Labs <[email protected]>
RUN apt-get update

RUN apt-get -y --force-yes install wget curl tar
RUN apt-get install -y --force-yes software-properties-common python-software-properties && sudo add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update
RUN apt-get install -y --force-yes g++-4.9

# Get embedded binaries from Dgraph.
RUN curl https://get.dgraph.io | bash
Expand Down
10 changes: 0 additions & 10 deletions wiki/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ theme = "hugo-docs"
# set by build script: title, baseurl
title = "Dgraph Documentation"

[params]
# Place the latest version at the beginning so that version selector can
# append '(latest)' to the version string
versions = [
"v0.7.6",
"v0.7.5",
"v0.7.4",
"master"
]

[[menu.main]]
name = "Get Started"
url = "/get-started/"
Expand Down
4 changes: 2 additions & 2 deletions wiki/nginx/docs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ server {
add_header Cache-Control "no-cache";

location = / {
return 307 /v0.7.5;
return 307 /v0.7.6;
}

location / {
try_files $uri $uri/index.html /v0.7.5/404.html;
try_files $uri $uri/index.html /v0.7.6/404.html;
}
}
16 changes: 16 additions & 0 deletions wiki/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,30 @@ GREEN='\033[32;1m'
RESET='\033[0m'
HOST=https://docs.dgraph.io

# Place the latest version at the beginning so that version selector can
# append '(latest)' to the version string
VERSIONS=(
'v0.7.6'
'master'
'v0.7.5'
'v0.7.4'
)

joinVersions() {
versions=$(printf ",%s" "${VERSIONS[@]}")
echo ${versions:1}
}

rebuild() {
echo -e "$(date) $GREEN Updating docs for branch: $1.$RESET"
# Generate new docs after merging.

# In Unix environments, env variables should also be exported to be seen by Hugo
export CURRENT_BRANCH=${1}
export VERSION_STRING=$(joinVersions)

HUGO_TITLE="Dgraph Doc ${2}"\
VERSIONS=${VERSION_STRING} \
CURRENT_BRANCH=${1} hugo\
--destination=public/"$2"\
--baseURL="$HOST"/"$2" 1> /dev/null
Expand Down

0 comments on commit 5f7eb75

Please sign in to comment.