working but work in progress for templating
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5m25s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5m25s
This commit is contained in:
@@ -22,17 +22,30 @@ def form(request):
|
||||
def handle_survey_form(request):
|
||||
config.load_kube_config(config_file='/kubeconfig/config')
|
||||
v1 = client.BatchV1Api()
|
||||
|
||||
name = request.GET.get('name')
|
||||
url = request.GET.get('url')
|
||||
|
||||
environment = Environment(loader=FileSystemLoader("django_code/stash_management/templates/"))
|
||||
template = environment.get_template("template.stash-pornpics-dowloader.job.yml")
|
||||
template = environment.get_template("template.stash-pornpics-dowloader.job.json")
|
||||
template = environment.get_template("template.stash-pornpics-dowloader.job.yaml")
|
||||
|
||||
pod_manifest_job = template.render(name=name, url=url)
|
||||
|
||||
|
||||
api_response = v1.create_namespaced_job(body=pod_manifest_job,namespace='stash')
|
||||
#filepath_manifest_path="django_code/stash_management/templates/template.stash-pornpics-dowloader.job.yaml"
|
||||
#filepath_manifest = open(filepath_manifest_path)
|
||||
|
||||
with open('django_code/stash_management/templates/template.stash-pornpics-dowloader.job.yaml', 'r') as file:
|
||||
prime_service = yaml.safe_load(file)
|
||||
|
||||
#api_response = v1.create_namespaced_job(body=pod_manifest_job,namespace='stash')
|
||||
api_response = v1.create_namespaced_job(body=prime_service,namespace='stash')
|
||||
|
||||
|
||||
|
||||
|
||||
#return HttpResponse(pod_manifest_job)
|
||||
|
||||
return HttpResponse(api_response)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user