Files
addons/crd/argo-workflows/index.rhai
2024-03-20 06:56:44 +01:00

36 lines
1.5 KiB
Plaintext

const VERSION="3.5.5";
const SRC=src;
const DEST=dest;
const DOIT=config.apply;
const crdFiles=[
"apiextensions.k8s.io_v1_CustomResourceDefinition_clusterworkflowtemplates.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_cronworkflows.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_workflowartifactgctasks.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_workfloweventbindings.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_workflows.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_workflowtaskresults.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_workflowtasksets.argoproj.io.yaml",
"apiextensions.k8s.io_v1_CustomResourceDefinition_workflowtemplates.argoproj.io.yaml",
];
fn pre_install() {
if ! global::DOIT {
return;
}
for file in global::crdFiles {
shell(`kubectl replace -f ${global::SRC}/${file} || kubectl create -f ${global::SRC}/${file}`);
}
}
fn post_destroy() {
if ! global::DOIT {
return;
}
for file in global::crdFiles {
shell(`kubectl delete -f ${global::SRC}/${file}`);
}
}
fn pre_pack() {
//shell(`kubectl kustomize https://github.com/argoproj/argo-workflows//manifests/base/crds/full/?ref=v${global::VERSION} > ${global::SRC}/argoworkflows.yaml`);
shell(`kubectl kustomize https://github.com/argoproj/argo-workflows//manifests/base/crds/?ref=v${global::VERSION} > ${global::SRC}/argoworkflows.yaml`);
}