Skip to content

Commit

Permalink
frontend arguments as env
Browse files Browse the repository at this point in the history
  • Loading branch information
heidermassu committed Jul 19, 2023
1 parent dbf5ab3 commit 8f7aa9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 7 additions & 5 deletions k8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ REGISTRY := ghcr.io/acregistry/otlp-blueprint
NAMESPACE_NAME := otlp
INSTALL_CERT_MANAGER ?= true
INSTALL_OTEL_OPERATOR ?= true
API_URL := http://127.0.0.1:3000
OTLP_COLLECTOR_URL := http://127.0.0.1:4318

########################################################################################################################
# Starting DEMO
Expand Down Expand Up @@ -44,24 +46,24 @@ build-and-push-all: build-all push-backend push-frontend

install-front-back: install-backend install-frontend

deployment-frontend: build-frontend push-frontend install-frontend
deployment-frontend: build-frontend push-frontend delete-frontend install-frontend

deployment-backend: build-backend push-backend install-backend
deployment-backend: build-backend push-backend delete-backend install-backend

#########################
# BUILD AND PUSH Scripts
#########################
build-backend:
@./scripts/build-backend.sh $(IMAGE_NAME)
@./scripts/build-backend.sh $(IMAGE_NAME)

build-frontend:
@./scripts/build-frontend.sh $(IMAGE_NAME)
@./scripts/build-frontend.sh $(IMAGE_NAME) $(API_URL) $(OTLP_COLLECTOR_URL)

push-backend:
@./scripts/push-backend.sh $(REGISTRY) $(IMAGE_NAME)

push-frontend:
@./scripts/push-backend.sh $(REGISTRY) $(IMAGE_NAME)
@./scripts/push-frontend.sh $(REGISTRY) $(IMAGE_NAME)

############
# Kind Scripts
Expand Down
8 changes: 6 additions & 2 deletions k8s/scripts/build-frontend.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

set -e

image_suffix="${1:-"otlp-blueprint"}"
image_suffix="${1:-$image_suffix}"
api_url="${2:-$API_URL}"
otlp_collector_url="${3:-$OTLP_COLLECTOR_URL}"

pushd ../
docker build --build-arg="API_URL=http://127.0.0.1:3000" --build-arg="OTLP_COLLECTOR_URL=http://127.0.0.1:4318" -t "$image_suffix"-frontend -f Frontend.dockerfile .
docker build --build-arg="API_URL=$api_url" --build-arg="OTLP_COLLECTOR_URL=$otlp_collector_url" -t "${image_suffix}-frontend" -f Frontend.dockerfile .
popd

0 comments on commit 8f7aa9d

Please sign in to comment.