@@ -6,31 +6,69 @@ includes:
66 aliases :
77 - rls
88 - r
9- vars :
10- VERSION :
11- sh : ' cat VERSION'
12- TASKFILE_DIR2 : " hack/common"
9+
10+ tools :
11+ taskfile : hack/common/tasks_tools.yaml
12+ aliases :
13+ - tools
14+ - t
15+
16+ vars :
17+ REPO_URL : " github.com/openmcp-project/gitops-templates"
18+ VERSION :
19+ sh : ' cat VERSION'
20+ COMMIT :
21+ sh : ' ( cd "{{.ROOT_DIR2}}"; git rev-parse HEAD )'
22+ ROOT_DIR2 : ' {{.ROOT_DIR | trimSuffix "/common" | trimSuffix "/hack"}}'
23+ TASKFILE_DIR2 :
24+ sh : ' if [[ "{{.TASKFILE_DIR}}" == "{{.ROOT_DIR2}}" ]] || [[ "{{.TASKFILE_DIR}}" == "" ]]; then echo -n "{{.ROOT_DIR2}}/hack/common"; else echo -n "{{.TASKFILE_DIR}}"; fi'
25+ LOCALBIN : ' {{ env "LOCALBIN" | default ( .LOCALBIN | default (print .ROOT_DIR2 "/bin") ) }}'
26+ LOCALTMP : ' {{ env "LOCALTMP" | default ( .LOCALTMP | default (print .ROOT_DIR2 "/tmp") ) }}'
27+ JQ : ' {{ .JQ | default (print .LOCALBIN "/jq") }}'
28+ HELM : ' {{ .HELM | default (print .LOCALBIN "/helm") }}'
29+ YAML2JSON : ' {{ .YAML2JSON | default (print .LOCALBIN "/yaml2json") }}'
30+ OCM : ' {{ .OCM | default (print .LOCALBIN "/ocm") }}'
31+ ENVTEST : ' {{ .ENVTEST | default (print .LOCALBIN "/setup-envtest") }}'
1332
1433tasks :
1534 build :
35+ deps :
36+ - tools:ocm
37+ - tools:localtmp
38+ vars :
39+ compdir : ' {{.LOCALTMP}}/component'
1640 desc : Build ocm component
1741 cmds :
42+ # - |
43+ # ocm add componentversions \
44+ # --copy-resources --force --create \
45+ # --file {{.compdir}} \
46+ # --settings settings.yaml \
47+ # component-constructor.yaml
1848 - |
19- ocm add componentversions \
20- --copy-resources --force --create \
21- --file .out \
22- --settings settings.yaml \
23- component-constructor.yaml
49+ "{{.OCM}}" add componentversions \
50+ --file "{{.compdir}}" \
51+ --version "{{.VERSION}}" \
52+ --create --force \
53+ --settings {{.ROOT_DIR2}}/settings.yaml \
54+ --templater subst "{{.ROOT_DIR2}}/component-constructor.yaml" -- \
55+ VERSION="{{.VERSION}}" \
56+ COMMIT="{{.COMMIT}}" \
57+ REPO_URL="{{.REPO_URL}}"
2458 lint :
2559 desc : Lint YAML files in templates directory
2660 cmds :
2761 - yamllint templates
2862
2963 push :
64+ deps :
65+ - tools:ocm
66+ - tools:localtmp
3067 desc : Push to OCM Registry
3168 cmds :
32- - ocm transfer ctf -f .out "{{.COMPONENT_REGISTRY}}" {{.overwrite_mod}}
69+ - ocm transfer ctf -f {{.compdir}} "{{.COMPONENT_REGISTRY}}" {{.overwrite_mod}}
3370 vars :
71+ compdir : ' {{.LOCALTMP}}/component'
3472 overwrite_mod :
3573 sh : ' if [[ -n ${OVERWRITE_COMPONENTS:-} ]] && [[ ${OVERWRITE_COMPONENTS} != "false" ]]; then echo -n "--overwrite"; fi'
3674 COMPONENT_REGISTRY :
0 commit comments