Skip to content

Commit 470840a

Browse files
MrBagojkbradley
authored andcommitted
Add flag to release script for publishing docs. (#178)
This PR makes building and publishing docs optional with the release script.
1 parent 00964c2 commit 470840a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

dev/release.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
import sys
77

88
DATABRICKS_REMOTE = "[email protected]:databricks/spark-deep-learning.git"
9-
PUBLISH_MODES = {"local": "publishLocal", "m2": "publishM2", "spark-package-publish": "spPublish"}
9+
PUBLISH_MODES = {
10+
"local": "publishLocal",
11+
"m2": "publishM2",
12+
"spark-package-publish": "spPublish",
13+
}
14+
PUBLISH_DOCS_DEFAULT = True
1015

1116
WORKING_BRANCH = "WORKING_BRANCH_RELEASE_%s_@%s"
1217
# lower case "z" puts the branch at the end of the github UI.
@@ -33,12 +38,14 @@ def verify(prompt, interactive):
3338
@click.command()
3439
@click.argument("release-version", type=str)
3540
@click.argument("next-version", type=str)
36-
@click.option("--publish-to", default="local",
41+
@click.option("--publish-to", default="local", show_default=True,
3742
help="Where to publish artifact, one of: %s" % list(PUBLISH_MODES.keys()))
3843
@click.option("--no-prompt", is_flag=True, help="Automated mode with no user prompts.")
3944
@click.option("--git-remote", default=DATABRICKS_REMOTE,
4045
help="Push current branch and docs to this git remote.")
41-
def main(release_version, next_version, publish_to, no_prompt, git_remote):
46+
@click.option("--publish-docs", type=bool, default=PUBLISH_DOCS_DEFAULT, show_default=True,
47+
help="Publish docs to github-pages.")
48+
def main(release_version, next_version, publish_to, no_prompt, git_remote, publish_docs):
4249
interactive = not no_prompt
4350

4451
time = datetime.now().strftime("%Y-%m-%dT%H-%M-%S")
@@ -110,7 +117,7 @@ def main(release_version, next_version, publish_to, no_prompt, git_remote):
110117

111118
prominentPrint("Building release docs")
112119

113-
if not verify("Would you like to build release docs? (y/n)", interactive):
120+
if not (publish_docs and verify("Would you like to build release docs? (y/n)", interactive)):
114121
# All done, exit happy
115122
sys.exit(0)
116123

0 commit comments

Comments
 (0)