Esempio n. 1
0
def helm(helm_repo, ver, dry_run):
    """Publish the Dagster Helm chart

    See: https://medium.com/containerum/how-to-make-and-share-your-own-helm-package-50ae40f6c221
    for more info on this process
    """

    helm_path = os.path.join(git_repo_root(), "python_modules", "libraries", "dagster-k8s", "helm")

    check.invariant(
        get_git_repo_branch(helm_repo) == "gh-pages", "helm repo must be on gh-pages branch"
    )

    cmd = [
        "helm",
        "package",
        "dagster",
        "-d",
        helm_repo,
        "--app-version",
        ver,
        "--version",
        ver,
    ]
    click.echo(click.style("Running command: " + " ".join(cmd) + "\n", fg="green"))
    click.echo(subprocess.check_output(cmd, cwd=helm_path))

    cmd = ["helm", "repo", "index", ".", "--url", "https://dagster-io.github.io/helm/"]
    click.echo(click.style("Running command: " + " ".join(cmd) + "\n", fg="green"))
    click.echo(subprocess.check_output(cmd, cwd=helm_repo))

    # Commit and push Helm updates for this Dagster release
    msg = "Helm release for Dagster release {}".format(ver)
    git_commit_updates(helm_repo, msg)
    git_push(cwd=helm_repo, dry_run=dry_run)
Esempio n. 2
0
def helm(chart_path, helm_repo, ver, dry_run):
    """Publish the Dagster Helm chart

    See: https://medium.com/containerum/how-to-make-and-share-your-own-helm-package-50ae40f6c221
    for more info on this process
    """

    helm_path = os.path.join(git_repo_root(), "helm")

    check.invariant(
        get_git_repo_branch(helm_repo) == "gh-pages", "helm repo must be on gh-pages branch"
    )

    cmd = [
        "helm",
        "package",
        chart_path,
        "--dependency-update",
        "--destination",
        helm_repo,
        "--app-version",
        ver,
        "--version",
        ver,
    ]
    click.echo(click.style("Running command: " + " ".join(cmd) + "\n", fg="green"))
    click.echo(subprocess.check_output(cmd, cwd=helm_path))

    cmd = [
        "helm",
        "repo",
        "index",
        ".",
        "--merge",
        "index.yaml",
        "--url",
        "https://dagster-io.github.io/helm/",
    ]
    click.echo(click.style("Running command: " + " ".join(cmd) + "\n", fg="green"))
    click.echo(subprocess.check_output(cmd, cwd=helm_repo))

    # Commit and push Helm updates for this Dagster release
    chart_name = os.path.basename(os.path.normpath(chart_path))
    msg = f"Helm release for {chart_name} release {ver}"
    git_commit_updates(helm_repo, msg)
    git_push(cwd=helm_repo, dry_run=dry_run)
Esempio n. 3
0
def helm(helm_repo, ver, dry_run):
    '''Publish the Dagster Helm chart

    See: https://medium.com/containerum/how-to-make-and-share-your-own-helm-package-50ae40f6c221
    for more info on this process
    '''

    helm_path = os.path.join(git_repo_root(), 'python_modules', 'libraries',
                             'dagster-k8s', 'helm')

    check.invariant(
        get_git_repo_branch(helm_repo) == 'gh-pages',
        'helm repo must be on gh-pages branch')

    cmd = [
        'helm',
        'package',
        'dagster',
        '-d',
        helm_repo,
        '--app-version',
        ver,
        '--version',
        ver,
    ]
    click.echo(
        click.style('Running command: ' + ' '.join(cmd) + '\n', fg='green'))
    click.echo(subprocess.check_output(cmd, cwd=helm_path))

    cmd = [
        'helm', 'repo', 'index', '.', '--url',
        'https://dagster-io.github.io/helm/'
    ]
    click.echo(
        click.style('Running command: ' + ' '.join(cmd) + '\n', fg='green'))
    click.echo(subprocess.check_output(cmd, cwd=helm_repo))

    # Commit and push Helm updates for this Dagster release
    msg = 'Helm release for Dagster release {}'.format(ver)
    git_commit_updates(helm_repo, msg)
    git_push(cwd=helm_repo, dry_run=dry_run)