allow specifying branch for main render
This commit is contained in:
parent
f959140f2a
commit
1ce60da9cf
|
@ -53,6 +53,7 @@ vars = {
|
|||
'tmp_dir': '/tmp',
|
||||
'force': False,
|
||||
'branch': None,
|
||||
'preview_branch': None,
|
||||
}
|
||||
|
||||
# logging time
|
||||
|
@ -156,19 +157,19 @@ published = False
|
|||
refs = cmd([GIT_PATH, 'diff-tree', '--no-commit-id', '--name-only', REF], cwd=GIT_REPO).split("\n")
|
||||
for r in refs:
|
||||
if FORCE or r == "PUBLISH.trigger.md":
|
||||
build_site(WEBSITE, TMP_WEBSITE)
|
||||
build_site(WEBSITE, TMP_WEBSITE, branch=BRANCH)
|
||||
published = True
|
||||
# Check if there is a !publish!
|
||||
if not published:
|
||||
refs = cmd([GIT_PATH, 'show', '--format="%s"', '-s'], cwd=GIT_REPO).split(' ')
|
||||
for r in refs:
|
||||
if r == "!publish!":
|
||||
build_site(WEBSITE, TMP_WEBSITE)
|
||||
build_site(WEBSITE, TMP_WEBSITE, branch=BRANCH)
|
||||
published = True
|
||||
# Let the world know if there hasn't been a publish
|
||||
if not published:
|
||||
print("The site wasn't build because there was no publish trigger, nor was it forced.")
|
||||
# create preview version
|
||||
build_site(WEBSITE_PREVIEW, TMP_WEBSITE_PREVIEW, branch=BRANCH, hugo_environment='preview')
|
||||
build_site(WEBSITE_PREVIEW, TMP_WEBSITE_PREVIEW, branch=PREVIEW_BRANCH, hugo_environment='preview')
|
||||
|
||||
# @TODO: link the library
|
Loading…
Reference in New Issue