def git_push(tag=None, dry_run=True): github_token = os.getenv('GITHUB_TOKEN') github_username = os.getenv('GITHUB_USERNAME') if github_token and github_username: if tag: check_output( [ 'git', 'push', 'https://{github_username}:{github_token}@github.com/dagster-io/dagster.git' .format(github_username=github_username, github_token=github_token), tag, ], dry_run=dry_run, ) check_output( [ 'git', 'push', 'https://{github_username}:{github_token}@github.com/dagster-io/dagster.git' .format(github_username=github_username, github_token=github_token), ], dry_run=dry_run, ) else: if tag: check_output(['git', 'push', 'origin', tag], dry_run=dry_run) check_output(['git', 'push'], dry_run=dry_run)
def commit_new_version(self, new_version, dry_run=True): try: for module in self.all_publishable_modules: cmd = [ 'git', 'add', module.version_file_path, ] check_output(cmd, dry_run=dry_run) cmd = [ 'git', 'commit', '--no-verify', '-m', '{new_version}'.format(new_version=new_version), ] check_output(cmd, dry_run=dry_run) except subprocess.CalledProcessError as exc_info: raise Exception(exc_info.output)