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 makefile issues due to rebasing over PR #35 #37

Merged
merged 1 commit into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
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
34 changes: 26 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ TOOL ?= oc
CLUSTER_IP ?= 192.168.99.100
PULL_POLICY ?= Always
WEBHOOK_ENABLED ?= false
DEFAULT_ROUTING ?= basic

all: help

Expand All @@ -28,22 +29,39 @@ endif

_update_yamls: _set_registry_url
sed -i "s|plugin.registry.url: .*|plugin.registry.url: http://$(PLUGIN_REGISTRY_HOST)|g" ./deploy/controller_config.yaml
sed -i "s|image: .*|image: $(IMG)|g" ./deploy/controller.yaml
sed -i "s|imagePullPolicy: Always|imagePullPolicy: $(PULL_POLICY)|g" ./deploy/controller.yaml
sed -i "s|che.webhooks.enabled: .*|che.webhooks.enabled: $(WEBHOOK_ENABLED)|g" ./deploy/controller.yaml
sed -i 's|che.webhooks.enabled: .*|che.webhooks.enabled: "$(WEBHOOK_ENABLED)"|g' ./deploy/controller_config.yaml
sed -i 's|che.default_routing_class: .*|che.default_routing_class: "$(DEFAULT_ROUTING)"|g' ./deploy/controller_config.yaml
ifeq ($(TOOL),oc)
sed -i "s|image: .*|image: $(IMG)|g" ./deploy/os/controller.yaml
sed -i "s|imagePullPolicy: Always|imagePullPolicy: $(PULL_POLICY)|g" ./deploy/os/controller.yaml
else
sed -i "s|image: .*|image: $(IMG)|g" ./deploy/k8s/controller.yaml
sed -i "s|imagePullPolicy: Always|imagePullPolicy: $(PULL_POLICY)|g" ./deploy/k8s/controller.yaml
endif

_reset_yamls: _set_registry_url
sed -i "s|http://$(PLUGIN_REGISTRY_HOST)|http://che-plugin-registry.192.168.99.100.nip.io/v3|g" ./deploy/controller_config.yaml
sed -i "s|image: $(IMG)|image: quay.io/che-incubator/che-workspace-controller:nightly|g" ./deploy/controller.yaml
sed -i "s|imagePullPolicy: $(PULL_POLICY)|imagePullPolicy: Always|g" ./deploy/controller.yaml
sed -i "s|che.webhooks.enabled: .*|che.webhooks.enabled: "false"|g" ./deploy/controller.yaml
sed -i 's|che.webhooks.enabled: .*|che.webhooks.enabled: "false"|g' ./deploy/controller_config.yaml
sed -i 's|che.default_routing_class: .*|che.default_routing_class: "basic"|g' ./deploy/controller_config.yaml
ifeq ($(TOOL),oc)
sed -i "s|image: $(IMG)|image: quay.io/che-incubator/che-workspace-controller:nightly|g" ./deploy/os/controller.yaml
sed -i "s|imagePullPolicy: $(PULL_POLICY)|imagePullPolicy: Always|g" ./deploy/os/controller.yaml
else
sed -i "s|image: $(IMG)|image: quay.io/che-incubator/che-workspace-controller:nightly|g" ./deploy/k8s/controller.yaml
sed -i "s|imagePullPolicy: $(PULL_POLICY)|imagePullPolicy: Always|g" ./deploy/k8s/controller.yaml
endif

_update_crds:
$(TOOL) apply -f ./deploy/crds
$(TOOL) apply -f ./deploy/controller_config.yaml

_deploy_controller:
$(TOOL) apply -f ./deploy
ifeq ($(TOOL),oc)
$(TOOL) apply -f ./deploy/os/
else
$(TOOL) apply -f ./deploy/k8s/
endif

### docker: build and push docker image
docker:
Expand Down Expand Up @@ -81,8 +99,8 @@ update: _update_yamls _update_crds _reset_yamls

### uninstall: remove namespace and all CRDs from cluster
uninstall:
# It's safer to delete all workspaces before deleting the controller; otherwise we could
# leave workspaces in a hanging state if we add finalizers.
# It's safer to delete all workspaces before deleting the controller; otherwise we could
# leave workspaces in a hanging state if we add finalizers.
ifneq ($(shell command -v kubectl),)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not work for me for some reasons I don't understand because of limited knowledge of makefiles
Screenshot_20200403_124352

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubectl delete workspaces.workspace.che.eclipse.org --all-namespaces --all
else
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The repository contains a Makefile; building and deploying can be configured via
| `CLUSTER_IP` | For Kubernetes only, the ip address of the cluster (`minikube ip`) | `192.168.99.100` |
| `PULL_POLICY` | Image pull policy for controller | `Always` |
| `WEBHOOK_ENABLED` | Whether webhooks should be enabled in the deployment | `false` |
| `DEFAULT_ROUTING` | Default routingClass to apply to workspaces that don't specify one | `basic` |

The makefile supports the following rules:

Expand Down