# get snap click.echo("Get snap {}".format(snap_name)) microk8s = launchpad.snaps.getByName(name=snap_name, owner=snappydev) self.snap = microk8s except HTTPError as e: click.echo("Cannot get snap {}. ({})".format( snap_name, e.response)) return None return self.snap if __name__ == "__main__": click.echo("Validating GH branches and LP builders of microk8s") for track in get_tracks(all=True): click.echo("Examining track {}".format(track)) upstream = upstream_release(track) if not upstream: click.echo("Nothing upstream for this track. Skipping.") continue # Take care of the GH branches if not is_latest(track) and not gh_branch_exists(track): click.echo("Creating a branch for {}".format(track)) create_gh_branch(track, gh_user, gh_token) click.echo("Creating GH branch from master.") # it will take at most 5 hours for LP to get the branch so # trying to create the LP builders now will fail. # We continue to the next track and we will create the LP builders # in the next execution of this script.
# Set this to 'no' if you are sure you want to release dry_run = os.environ.get('DRY_RUN', 'yes') # Set this to 'yes' to bypass any check such as new version present. always_release = os.environ.get('ALWAYS_RELEASE', 'no') # If TESTS_BRANCH is not set the tests branch will be the one matching the track tests_branch = os.environ.get('TESTS_BRANCH') if tests_branch and tests_branch.strip() == '': tests_branch = None # If you do not specify TRACKS all tracks will be processes tracks_requested = os.environ.get('TRACKS') if not tracks_requested or tracks_requested.strip() == '': tracks_requested = get_tracks() else: tracks_requested = tracks_requested.split() # Set this to the proxy your environment may have proxy = os.environ.get('PROXY') if not proxy or proxy.strip() == '': proxy = None # If JUJU_UNIT is not set the tests will be run in local LXC containers juju_unit = os.environ.get('JUJU_UNIT') if juju_unit and juju_unit.strip() == '': juju_unit = None juju_controller = os.environ.get('JUJU_CONTROLLER') if juju_controller and juju_controller.strip() == '':