Skip to content

Commit

Permalink
Makefile: add build targets and fix deploy on ocp
Browse files Browse the repository at this point in the history
This commit add two targets for buid: _build-api_ and _build-agent_.
Also, it fixes the deploy-on-openshift target.

Signed-off-by: Cosmin Tupangiu <[email protected]>
  • Loading branch information
tupyy authored and machacekondra committed Oct 25, 2024
1 parent b842aee commit 2a0b52e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ build: bin image
go build -buildvcs=false $(GO_BUILD_FLAGS) -o $(GOBIN) ./cmd/...

build-api: bin
go build -buildvcs=false $(GO_BUILD_FLAGS) -o $(GOBIN) ./cmd/migration-planner-api
go build -buildvcs=false $(GO_BUILD_FLAGS) -o $(GOBIN) ./cmd/planner-api ...

build-agent: bin
go build -buildvcs=false $(GO_BUILD_FLAGS) -o $(GOBIN) ./cmd/planner-agent ...


# rebuild container only on source changes
Expand All @@ -97,13 +100,12 @@ push-containers: build-containers
deploy-on-openshift:
sed 's|@MIGRATION_PLANNER_API_IMAGE@|$(MIGRATION_PLANNER_API_IMAGE)|g' deploy/k8s/migration-planner.yaml.template > deploy/k8s/migration-planner.yaml
sed 's|@MIGRATION_PLANNER_UI_IMAGE@|$(MIGRATION_PLANNER_UI_IMAGE)|g' deploy/k8s/migration-planner-ui.yaml.template > deploy/k8s/migration-planner-ui.yaml
oc apply -f 'deploy/k8s/*-service.yaml'
oc apply -f 'deploy/k8s/*-secret.yaml'
ls deploy/k8s | awk '/secret|service/' | xargs -I {} oc apply -f deploy/k8s/{}
oc create route edge planner --service=migration-planner-ui || true
oc expose service migration-planner-agent --name planner-agent || true
@config_server=$$(oc get route planner-agent -o jsonpath='{.spec.host}'); \
oc create secret generic migration-planner-secret --from-literal=config_server=http://$$config_server || true
oc apply -f deploy/k8s/
ls deploy/k8s | awk '! /secret|service/' | xargs -I {} oc apply -f deploy/k8s/{}

undeploy-on-openshift:
oc delete route planner || true
Expand Down

0 comments on commit 2a0b52e

Please sign in to comment.