Skip to content

Commit

Permalink
Add flag to release script for publishing docs. (#178)
Browse files Browse the repository at this point in the history
This PR makes building and publishing docs optional with the release script.
  • Loading branch information
MrBago authored and jkbradley committed Dec 7, 2018
1 parent 00964c2 commit 470840a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions dev/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import sys

DATABRICKS_REMOTE = "git@github.com:databricks/spark-deep-learning.git"
PUBLISH_MODES = {"local": "publishLocal", "m2": "publishM2", "spark-package-publish": "spPublish"}
PUBLISH_MODES = {
"local": "publishLocal",
"m2": "publishM2",
"spark-package-publish": "spPublish",
}
PUBLISH_DOCS_DEFAULT = True

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

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

prominentPrint("Building release docs")

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

Expand Down

0 comments on commit 470840a

Please sign in to comment.