Skip to content

Kubernetes Functions

Revant Nandgaonkar edited this page Jul 5, 2021 · 5 revisions

check k8s.py

import frappe
from erpnext_feature_board.client.k8s import (
    create_build_image_job,
    create_helm_release,
    delete_helm_release,
)

improvement = frappe.get_doc("Improvement", "GH-IMP-2021-00082")

# Create job to build and push PR images to private registry
create_build_image_job(
    improvement_name=improvement.name,
    image_tag="version-13",
    git_repo=improvement.fork_url,
    git_branch=improvement.source_branch,
)
# Wait for 5-10 minutes for the build job to complete before proceeding with further functions

# Create helm release
# Creates site and ingress gh-imp-2021-00082.test-erpnext.org
create_helm_release("GH-IMP-2021-00082")

# Delete helm release
# Drops site gh-imp-2021-00082.test-erpnext.org and deletes ingress
delete_helm_release("GH-IMP-2021-00082")
Clone this wiki locally