argo-cd/hack/goreman-start.sh
pasha-codefresh ae803a2f1e
feat: goreman option to exclude (#7080)
feat: goreman option to exclude (#7080)

Signed-off-by: pashavictorovich <pavel@codefresh.io>
2021-08-25 12:40:55 -07:00

37 lines
No EOL
814 B
Bash

#!/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