def download_blueprint_resource(self, blueprint_id, resource_path, logger, target_path=None): return manager.download_blueprint_resource(blueprint_id, resource_path, logger, target_path)
def download_blueprint_resource(self, resource_path, target_path=None): blueprint_id = self.workflow_ctx.blueprint.id logger = self.workflow_ctx.logger return download_blueprint_resource(blueprint_id=blueprint_id, resource_path=resource_path, target_path=target_path, logger=logger)
def download_blueprint_resource(self, blueprint_id, resource_path, logger, target_path=None, template_variables=None): resource = manager.download_blueprint_resource( blueprint_id=blueprint_id, resource_path=resource_path, logger=logger, target_path=target_path) return self._render_resource_if_needed( resource=resource, template_variables=template_variables, download=True)
def kube_create(**kwargs): setfabenv(kwargs) url=kwargs['url'] #get manifest if(url[0:4]=='http'): #external run("wget -O /tmp/manifest.yaml "+url) else: #in blueprint dir res=manager.download_blueprint_resource(ctx.blueprint.id,url,ctx.logger) put(res,"/tmp/manifest.yaml") run("./kubectl -s http://localhost:8080 create -f /tmp/manifest.yaml")
def kube_create(**kwargs): setfabenv(kwargs) url = kwargs['url'] #get manifest if (url[0:4] == 'http'): #external run("wget -O /tmp/manifest.yaml " + url) else: #in blueprint dir with open("/tmp/log", "a") as f: f.write("getting manifest\n") res = manager.download_blueprint_resource(ctx.blueprint.id, url, ctx.logger) put(res, "/tmp/manifest.yaml") run("./kubectl -s http://localhost:8080 create -f /tmp/manifest.yaml")
def execute_workflow(script_path, **kwargs): ctx = workflows_ctx._get_current_object() script_path = download_blueprint_resource(ctx.blueprint_id, script_path, ctx.logger) return process(eval_script, script_path, ctx)