Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: basic service port override when the service is set #269

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion legacy/build-deploy-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,20 @@ do

HELM_SERVICE_TEMPLATE="templates/service.yaml"
if [ -f /kubectl-build-deploy/helmcharts/${SERVICE_TYPE}/$HELM_SERVICE_TEMPLATE ]; then
SERVICE_OVERRIDES=()
if [[ "$SERVICE_TYPE" == "basic" ]] ||
[[ "$SERVICE_TYPE" == "basic-persistent" ]]; then
SERVICE_PORT_NUMBER=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.service\\.port false)
if [ ! $SERVICE_PORT_NUMBER == "false" ]; then
# check if the port provided is actually a number
if ! [[ $SERVICE_PORT_NUMBER =~ ^[0-9]+$ ]] ; then
echo "Provided service port is not a number"; exit 1;
fi
SERVICE_OVERRIDES+=(--set "service.port=${SERVICE_PORT_NUMBER}")
fi
fi
cat /kubectl-build-deploy/values.yaml
helm template ${SERVICE_NAME} /kubectl-build-deploy/helmcharts/${SERVICE_TYPE} -s $HELM_SERVICE_TEMPLATE -f /kubectl-build-deploy/values.yaml "${HELM_ARGUMENTS[@]}" > $YAML_FOLDER/service-${SERVICE_NAME}.yaml
helm template ${SERVICE_NAME} /kubectl-build-deploy/helmcharts/${SERVICE_TYPE} -s $HELM_SERVICE_TEMPLATE -f /kubectl-build-deploy/values.yaml "${SERVICE_OVERRIDES[@]}" "${HELM_ARGUMENTS[@]}" > $YAML_FOLDER/service-${SERVICE_NAME}.yaml
fi

HELM_DBAAS_TEMPLATE="templates/dbaas.yaml"
Expand Down
Loading