feat: goreman option to exclude (#7080)

feat: goreman option to exclude (#7080)

Signed-off-by: pashavictorovich <pavel@codefresh.io>
This commit is contained in:
pasha-codefresh 2021-08-25 22:40:55 +03:00 committed by GitHub
parent 49a854a738
commit ae803a2f1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View file

@ -451,6 +451,12 @@ start-local: mod-vendor-local dep-ui-local
ARGOCD_E2E_TEST=false \
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
# Run goreman start with exclude option , provide exclude env variable with list of services
.PHONY: run
run:
bash ./hack/goreman-start.sh
# Runs pre-commit validation with the virtualized toolchain
.PHONY: pre-commit
pre-commit: codegen build lint test

37
hack/goreman-start.sh Normal file
View file

@ -0,0 +1,37 @@
#!/usr/bin/env bash
declare -a services=("controller" "api-server" "redis" "repo-server" "ui")
EXCLUDE=$exclude
declare -a servicesToRun=()
if [ "$EXCLUDE" != "" ]; then
# Parse services list by ',' character
servicesToExclude=($(echo "$EXCLUDE" | tr ',' '\n'))
# Find subset of items from services array that not include servicesToExclude items
for element in "${services[@]}"
do
found=false
for excludedSvc in "${servicesToExclude[@]}"
do
if [[ "$excludedSvc" == "$element" ]]; then
found=true
fi
done
if [[ "$found" == false ]]; then
servicesToRun+=($element)
fi
done
fi
command="goreman start "
for element in "${servicesToRun[@]}"
do
command+=$element
command+=" "
done
eval $command