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

feat: use build tool to generate ingress templates #3133

Merged
merged 10 commits into from
May 14, 2022
3 changes: 3 additions & 0 deletions images/kubectl-build-deploy-dind/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ENV DBAAS_OPERATOR_HTTP=dbaas.lagoon.svc:5000
RUN curl -sSL https://github.com/uselagoon/lagoon-linter/releases/download/v0.5.0/lagoon-linter_0.5.0_linux_amd64.tar.gz \
| tar -xz -C /usr/local/bin lagoon-linter

RUN curl -sSL https://github.com/uselagoon/build-deploy-tool/releases/download/v0.4.3/build-deploy-tool_0.4.3_linux_amd64.tar.gz \
| tar -xz -C /usr/local/bin build-deploy-tool

RUN curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin > /dev/null 2>&1
#curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin > /dev/null 2>&1

Expand Down
16 changes: 11 additions & 5 deletions images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -981,11 +981,16 @@ do
FASTLY_ARGS=()
# if the feature is enabled, then do what is required to generated the labels/annotations etc
if [ ! -z $LAGOON_FASTLY_AUTOGENERATED ] && [ "$LAGOON_FASTLY_AUTOGENERATED" == "enabled" ]; then

# work out if there are any lagoon api variable overrides for the annotations that are being added
. /kubectl-build-deploy/scripts/exec-fastly-annotations.sh
# if we get any other populated service id overrides in any of the steps in exec-fastly-annotations.sh
FASTLY_CONFIG=$(build-deploy-tool config fastly --ingress-domain "${ROUTE_DOMAIN}")
LAGOON_FASTLY_SERVICE_ID=$(echo ${FASTLY_CONFIG} | jq -r '."service-id" // ""')
LAGOON_FASTLY_SERVICE_WATCH=$(echo ${FASTLY_CONFIG} | jq -r '."watch" // false')
LAGOON_FASTLY_SERVICE_API_SECRET=$(echo ${FASTLY_CONFIG} | jq -r '."api-secret-name" // ""')

# if we get any other populated service id overrides in any of the steps in lagoon-routegen
# make it available to the ingress creation here by overriding what may be defined in the lagoon.yml
# `LAGOON_FASTLY_SERVICE_ID` is created in the exec-fastly-annotations.sh script
# `LAGOON_FASTLY_SERVICE_ID` is set by the lagoon-routegen script
if [ ! -z "$LAGOON_FASTLY_SERVICE_ID" ]; then
ROUTE_FASTLY_SERVICE_ID=$LAGOON_FASTLY_SERVICE_ID
ROUTE_FASTLY_SERVICE_WATCH=$LAGOON_FASTLY_SERVICE_WATCH
Expand Down Expand Up @@ -1062,8 +1067,9 @@ TEMPLATE_PARAMETERS=()
### CUSTOM ROUTES
##############################################

# Run the route generation script
. /kubectl-build-deploy/scripts/exec-routes-generation.sh
# Run the route generation process
build-deploy-tool template ingress
MAIN_CUSTOM_ROUTE=$(build-deploy-tool identify primary-ingress)

set +x
currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading