Skip to content

Commit 03ec090

Browse files
author
Paul Korzhyk
committed
Add env var to configure base URL
1 parent 64981f1 commit 03ec090

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/build.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import functools
22
import json
3+
import os
34
import re
45
import semver
56
import subprocess as sp
67

8+
BASE_URL_ENV = 'TOUR_BASE_URL'
9+
710
def exec(*argv):
811
print("$>"," ".join(argv))
912
res = sp.run(argv, capture_output=True)
@@ -16,11 +19,16 @@ def exec(*argv):
1619

1720

1821
def runHugo(outSuffix=""):
22+
baseUrl = "http://tour.dgraph.io/"
23+
if BASE_URL_ENV in os.environ:
24+
baseUrl = os.environ[BASE_URL_ENV]
25+
baseUrl += outSuffix
26+
1927
return exec(
2028
"hugo",
2129
"--destination=public/" + outSuffix,
2230
"--baseURL",
23-
"https://tour.dgraph.io/" + outSuffix,
31+
baseUrl,
2432
"--config",
2533
"config.toml,releases.json",
2634
)

0 commit comments

Comments
 (0)