Skip to content

Commit

Permalink
MGMT-1765: Added environment variable
Browse files Browse the repository at this point in the history
Added variables to makefile, skipper and README.md
  • Loading branch information
RazRegev committed Aug 11, 2020
1 parent ba12ce8 commit 4d8631f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SKIPPER_PARAMS ?= -i
SERVICE_BRANCH := $(or $(SERVICE_BRANCH), "master")
SERVICE_REPO := $(or $(SERVICE_REPO), "https://github.com/openshift/assisted-service")
SERVICE := $(or $(SERVICE), quay.io/ocpmetal/assisted-service:latest)
SERVICE_NAME := $(or $(SERVICE_NAME),assisted-service)

# nodes params
ISO := $(or $(ISO), "") # ISO should point to a file that has the '.iso' extension. Otherwise deploy will fail!
Expand Down Expand Up @@ -49,6 +50,16 @@ DEPLOY_TAG := $(or $(DEPLOY_TAG), "")
IMAGE_NAME=test-infra
IMAGE_REG_NAME=quay.io/itsoiref/$(IMAGE_NAME)

# oc deploy
OC_MODE := $(or $(OC_MODE),)
ifneq ($(OC_MODE),)
ADDITIONAL_PARAMS = --oc-mode
endif

OC_USER := $(or $(OC_USER),"")
OC_PASS := $(or $(OC_PASS),"")
OC_SCHEME := $(or $(OC_SCHEME),http)

.EXPORT_ALL_VARIABLES:


Expand Down Expand Up @@ -151,7 +162,7 @@ kill_all_port_forwardings:
###########

_install_cluster:
discovery-infra/install_cluster.py -id $(CLUSTER_ID) -ps '$(PULL_SECRET)' -ns $(NAMESPACE)
discovery-infra/install_cluster.py -id $(CLUSTER_ID) -ps '$(PULL_SECRET) --service-name $(SERVICE_NAME) -ocu $(OC_USER) -ocp $(OC_PASS) -ocs $(OC_SCHEME) $(ADDITIONAL_PARAMS)' -ns $(NAMESPACE)

install_cluster:
skipper make _install_cluster NAMESPACE=$(NAMESPACE) $(SKIPPER_PARAMS)
Expand All @@ -162,16 +173,16 @@ install_cluster:
#########

_deploy_nodes:
discovery-infra/start_discovery.py -i $(ISO) -n $(NUM_MASTERS) -p $(STORAGE_POOL_PATH) -k '$(SSH_PUB_KEY)' -md $(MASTER_DISK) -wd $(WORKER_DISK) -mm $(MASTER_MEMORY) -wm $(WORKER_MEMORY) -nw $(NUM_WORKERS) -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -vN $(NETWORK_CIDR) -nN $(NETWORK_NAME) -nB $(NETWORK_BRIDGE) -nM $(NETWORK_MTU) -ov $(OPENSHIFT_VERSION) -rv $(RUN_WITH_VIPS) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) $(ADDITIONAL_PARAMS)
discovery-infra/start_discovery.py -i $(ISO) -n $(NUM_MASTERS) -p $(STORAGE_POOL_PATH) -k '$(SSH_PUB_KEY)' -md $(MASTER_DISK) -wd $(WORKER_DISK) -mm $(MASTER_MEMORY) -wm $(WORKER_MEMORY) -nw $(NUM_WORKERS) -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -vN $(NETWORK_CIDR) -nN $(NETWORK_NAME) -nB $(NETWORK_BRIDGE) -nM $(NETWORK_MTU) -ov $(OPENSHIFT_VERSION) -rv $(RUN_WITH_VIPS) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) --service-name $(SERVICE_NAME) -ocu $(OC_USER) -ocp $(OC_PASS) -ocs $(OC_SCHEME) $(ADDITIONAL_PARAMS)

deploy_nodes_with_install:
skipper make _deploy_nodes NAMESPACE=$(NAMESPACE) ADDITIONAL_PARAMS=-in $(SKIPPER_PARAMS)
skipper make _deploy_nodes NAMESPACE=$(NAMESPACE) ADDITIONAL_PARAMS='${ADDITIONAL_PARAMS}\ -in' $(SKIPPER_PARAMS)

deploy_nodes:
skipper make _deploy_nodes NAMESPACE=$(NAMESPACE) $(SKIPPER_PARAMS)

destroy_nodes:
skipper run 'discovery-infra/delete_nodes.py -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -ns $(NAMESPACE)' $(SKIPPER_PARAMS)
skipper run 'discovery-infra/delete_nodes.py -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -ns $(NAMESPACE) --service-name $(SERVICE_NAME) -ocu $(OC_USER) -ocp $(OC_PASS) -ocs $(OC_SCHEME) $(ADDITIONAL_PARAMS)' $(SKIPPER_PARAMS)

redeploy_nodes: destroy_nodes deploy_nodes

Expand Down Expand Up @@ -199,7 +210,7 @@ delete_all_virsh_resources: destroy_nodes delete_minikube
#######

_download_iso:
discovery-infra/start_discovery.py -k '$(SSH_PUB_KEY)' -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -ov $(OPENSHIFT_VERSION) -pU $(PROXY_URL) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) -iO
discovery-infra/start_discovery.py -k '$(SSH_PUB_KEY)' -ps '$(PULL_SECRET)' -bd $(BASE_DOMAIN) -cN $(CLUSTER_NAME) -ov $(OPENSHIFT_VERSION) -pU $(PROXY_URL) -iU $(REMOTE_SERVICE_URL) -id $(CLUSTER_ID) -mD $(BASE_DNS_DOMAINS) -ns $(NAMESPACE) --service-name $(SERVICE_NAME) -ocu $(OC_USER) -ocp $(OC_PASS) -ocs $(OC_SCHEME) $(ADDITIONAL_PARAMS) -iO

download_iso:
skipper make _download_iso NAMESPACE=$(NAMESPACE) $(SKIPPER_PARAMS)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ Check the [Install Guide](GUIDE.md) for installation instructions.
| CONNECTIVITY_CHECK_IMAGE | connectivity-check image to use, will update assisted-service config map with given value |
| HARDWARE_INFO_IMAGE | hardware-info image to use, will update assisted-service config map with given value |
| INVENTORY_IMAGE | assisted-service image to be updated in assisted-service config map with given value |
| OC_MODE | If set, use oc instead of minikube |
| OC_USER | Username for oc login |
| OC_PASS | Password for oc login |
| OC_SCHEME | Scheme for assisted-service url on oc, default: http |
| SERVICE_NAME | assisted-service target service name, default: assisted-service |

## Instructions

Expand Down
5 changes: 5 additions & 0 deletions skipper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ env:
CONNECTIVITY_CHECK_IMAGE: $CONNECTIVITY_CHECK_IMAGE
HARDWARE_INFO_IMAGE: $HARDWARE_INFO_IMAGE
INVENTORY_IMAGE: $INVENTORY_IMAGE
SERVICE_NAME: $SERVICE_NAME
OC_USER: $OC_USER
OC_PASS: $OC_PASS
OC_SCHEME: $OC_SCHEME
ADDITIONAL_PARAMS: $ADDITIONAL_PARAMS

0 comments on commit 4d8631f

Please sign in to comment.