diff --git a/.tasks/check-tools.yaml b/.tasks/check-tools.yaml new file mode 100644 index 000000000..59e31bded --- /dev/null +++ b/.tasks/check-tools.yaml @@ -0,0 +1,36 @@ +version: '3' + +tasks: + check-all: + cmds: + - task: check-helm + - task: check-helm-plugins + - task: check-docker + - task: check-docker-compose + - task: check-java + + check-helm: + dir: .tasks + cmds: + - pwd + - ./check_bin_{{OS}}.sh helm https://helm.sh/docs/intro/quickstart/#install-helm + + check-helm-plugins: + dir: .tasks + cmds: + - ./check_helm_plugin_{{OS}}.sh unittest + + check-docker: + dir: .tasks + cmds: + - ./check_bin_{{OS}}.sh docker https://www.docker.com + + check-docker-compose: + dir: .tasks + cmds: + - ./check_bin_{{OS}}.sh docker-compose https://www.docker.com + + check-java: + dir: .tasks + cmds: + - ./check_bin_{{OS}}.sh java https://www.codejava.net/java-core/install-openjdk-17-on-macos diff --git a/.tasks/check_bin_darwin.sh b/.tasks/check_bin_darwin.sh new file mode 100755 index 000000000..3a253e42f --- /dev/null +++ b/.tasks/check_bin_darwin.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh + +RESULT=$(which $1) + +if [[ $RESULT =~ "not found" ]]; +then + echo "Binary not found!" + echo "You can install it from here: $2" + exit 1 +else + echo "Binary found in: $RESULT" +fi \ No newline at end of file diff --git a/.tasks/check_helm_plugin_darwin.sh b/.tasks/check_helm_plugin_darwin.sh new file mode 100755 index 000000000..b6eec68fd --- /dev/null +++ b/.tasks/check_helm_plugin_darwin.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env zsh + +RESULT=$(helm plugin list | tail -n +2) + +if [[ $RESULT =~ $1 ]]; +then + echo "Plugin found! Info: $RESULT" +else + echo "Plugin not found" + exit 1 +fi \ No newline at end of file diff --git a/Taskfile.yaml b/Taskfile.yaml index fd2e09a54..640f60f71 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -10,7 +10,7 @@ tasks: cmds: - helm unittest . - build: + buildApp: desc: Build the whole app cmds: - ./gradlew build -PgithubToken=xxx -x test -x jacocoTestCoverageVerification @@ -18,10 +18,10 @@ tasks: buildDocker: desc: Build the app and the corresponding Docker image (tagged as "miw-test") cmds: - - task: build + - task: buildApp - docker build -t local-miw --platform linux/amd64 . - runDevEnv: + startDevContainers: desc: Spin up local Docker environment dir: dev-assets/dev-containers ignore_error: true @@ -31,22 +31,22 @@ tasks: cmds: - "docker-compose up {{ .OPTIONS }} {{ .CONTAINERS }}" - stopDevEnv: + stopDevContainers: desc: Stop local Docker environment dir: dev-assets/dev-containers cmds: - docker-compose down - runDockerApp: + startDockerApp: desc: Run the app in a container environment cmds: - - task: runDevEnv + - task: startDevContainers vars: OPTIONS: "-d" - task: buildDocker - cmd: docker rm miw-app ignore_error: true - - task: runDevEnv + - task: startDevContainers vars: CONTAINERS: "local_miw_app" @@ -54,9 +54,9 @@ tasks: desc: Stop all running containers cmds: - docker stop local_miw_app - - task: stopDevEnv + - task: stopDevContainers - clean: + cleanAll: desc: Cleans everything... cmds: - ./gradlew clean \ No newline at end of file