1+ version : " 3"
2+
3+ vars :
4+ # Variables for Docker image
5+ REGISTRY : {{.REGISTRY | default (print "ghcr.io/openmcp-project") }}
6+ IMAGE_NAME : mcp-ui-frontend
7+ IMAGE_TAG : ' {{.TAG | default "latest"}}'
8+ DOCKER_IMAGE : " {{.REGISTRY}}/{{.IMAGE_NAME}}:{{.IMAGE_TAG}}"
9+
10+ # Variables for OCM component
11+ OCM_COMPONENT_NAME : github.com/openmcp-project/ui
12+ OCM_COMPONENT_VERSION : ' {{.OCM_COMPONENT_VERSION | default .IMAGE_TAG}}'
13+ OCM_PROVIDER : openmcp-project
14+ OCM_TARGET_REPO : ' {{.OCM_TARGET_REPO | default (print .REGISTRY "/components") }}'
15+ OCM_OUTPUT_DIR : " {{.ROOT_DIR}}/.ctf"
16+ OCM_DESCRIPTOR : " {{.ROOT_DIR}}/ocm/component-descriptor.yaml"
17+
18+ tasks :
19+ default :
20+ desc : Show available tasks
21+ cmds :
22+ - task --list
23+
24+ build:ocm :
25+ desc : " Builds the ocm component. Usage: task build:ocm -- <version>"
26+ cmds :
27+ - rm -rf {{.OCM_OUTPUT_DIR}}
28+ - |
29+ ocm add components --create \
30+ --lookup {{.OCM_TARGET_REPO}} \
31+ --file {{.OCM_OUTPUT_DIR}} \
32+ {{.OCM_DESCRIPTOR}} -- \
33+ VERSION={{.OCM_COMPONENT_VERSION}} \
34+ COMPONENT_NAME={{.OCM_COMPONENT_NAME}} \
35+ PROVIDER={{.OCM_PROVIDER}}
36+ vars :
37+ OCM_COMPONENT_VERSION : ' {{.CLI_ARGS}}'
38+
39+ publish:ocm :
40+ desc : " Publishes the ocm component to the registry."
41+ cmds :
42+ - |
43+ ocm transfer ctf \
44+ {{.OCM_OUTPUT_DIR}} {{.OCM_TARGET_REPO}}
45+
46+ build:image:local :
47+ desc : " Builds the docker image for local testing. Usage: task test:build-image TAG=v-local-test"
48+ cmds :
49+ - docker build -t {{.DOCKER_IMAGE}} .
50+
51+ publish:image:local :
52+ desc : " Publishes the docker image for local testing. Usage: task test:publish-image TAG=v-local-test"
53+ cmds :
54+ - docker push {{.DOCKER_IMAGE}}
0 commit comments