Skip to content

Commit

Permalink
Fix bugs in the release script. (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewi authored Oct 30, 2017
1 parent 7fce996 commit 7539bc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 3 additions & 6 deletions py/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,9 @@ def get_last_release(bucket):
logging.info("File %s doesn't exist.", util.to_gcs_uri(bucket.name, path))
return ""


data = blob.download_to_string()

contents = blob.download_as_string()

data = json.dumps(contents)
data = json.loads(contents)
return data.get("sha", "")

def create_latest(bucket, sha, target):
Expand Down Expand Up @@ -126,8 +123,8 @@ def build_once(bucket_name): # pylint: disable=too-many-locals
src_dir = tempfile.mkdtemp(prefix="tmpTfJobSrc")
logging.info("src_dir: %s", src_dir)

sha = util.clone_repo(src_dir, util.MASTER_REPO_OWNER, util.MASTER_REPO_NAME,
sha)
_, sha = util.clone_repo(src_dir, util.MASTER_REPO_OWNER, util.MASTER_REPO_NAME,
sha)

# TODO(jlewi): We should check if we've already done a push. We could
# check if the .tar.gz for the helm package exists.
Expand Down
6 changes: 5 additions & 1 deletion py/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ def clone_repo(dest, repo_owner=MASTER_REPO_OWNER, repo_name=MASTER_REPO_NAME,
sha=None):
"""Clone the repo,
Returns:
Args:
dest: This is the root path for the training code.
repo_owner: The owner for github organization.
repo_name: The repo name.
sha: The sha number of the repo.
Returns:
dest: Directory where it was checked out
sha: The sha of the code.
"""
# Clone mlkube
repo = "https://github.com/{0}/{1}.git".format(repo_owner, repo_name)
Expand Down

0 comments on commit 7539bc8

Please sign in to comment.