Skip to content

Commit

Permalink
feat(devel): rename tasks in Taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoscode committed Jun 23, 2023
1 parent 0c4166d commit cdde677
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 9 deletions.
36 changes: 36 additions & 0 deletions .tasks/check-tools.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .tasks/check_bin_darwin.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .tasks/check_helm_plugin_darwin.sh
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ tasks:
cmds:
- helm unittest .

build:
buildApp:
desc: Build the whole app
cmds:
- ./gradlew build -PgithubToken=xxx -x test -x jacocoTestCoverageVerification

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
Expand All @@ -31,32 +31,32 @@ 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"

stopDockerApp:
desc: Stop all running containers
cmds:
- docker stop local_miw_app
- task: stopDevEnv
- task: stopDevContainers

clean:
cleanAll:
desc: Cleans everything...
cmds:
- ./gradlew clean

0 comments on commit cdde677

Please sign in to comment.