mirror of
https://github.com/goharbor/harbor.git
synced 2026-10-23 10:08:57 +03:00
21 lines
689 B
Python
21 lines
689 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import base
|
|
|
|
|
|
def helm_registry_login(ip, user, password):
|
|
command = ["helm", "registry", "login", ip, "-u", user, "-p", password, "--insecure"]
|
|
base.run_command(command)
|
|
|
|
def helm_package(file_path):
|
|
command = ["helm", "package", file_path]
|
|
base.run_command(command)
|
|
|
|
def helm_push(file_path, ip, project_name):
|
|
allow_insecure = base.getenv_bool("ALLOW_INSECURE", default=True)
|
|
if allow_insecure:
|
|
command = ["helm", "push", file_path, "oci://{}/{}".format(ip, project_name), "--insecure-skip-tls-verify"]
|
|
else:
|
|
command = ["helm", "push", file_path, "oci://{}/{}".format(ip, project_name)]
|
|
base.run_command(command)
|