github.com/blystad/deis@v0.11.0/includes.mk (about)

     1  ifndef FLEETCTL
     2    FLEETCTL = fleetctl --strict-host-key-checking=false
     3  endif
     4  
     5  ifndef FLEETCTL_TUNNEL
     6  $(error You need to set FLEETCTL_TUNNEL to the IP address of a server in the cluster.)
     7  endif
     8  
     9  ifndef DEIS_NUM_INSTANCES
    10    DEIS_NUM_INSTANCES = 1
    11  endif
    12  
    13  ifndef DEIS_HOSTS
    14    DEIS_HOSTS = $(shell seq -f "172.17.8.%g" -s " " 100 1 `expr $(DEIS_NUM_INSTANCES) + 99` )
    15  endif
    16  
    17  ifndef DEIS_NUM_ROUTERS
    18    DEIS_NUM_ROUTERS = 1
    19  endif
    20  
    21  ifndef DEIS_FIRST_ROUTER
    22    DEIS_FIRST_ROUTER = 1
    23  endif
    24  
    25  DEIS_LAST_ROUTER = $(shell echo $(DEIS_FIRST_ROUTER)\+$(DEIS_NUM_ROUTERS)\-1 | bc)
    26  
    27  define ssh_all
    28    for host in $(DEIS_HOSTS); do ssh -o LogLevel=FATAL -o Compression=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PasswordAuthentication=no core@$$host -t $(1); done
    29  endef
    30  
    31  define rsync_all
    32    for host in $(DEIS_HOSTS); do rsync -Pave "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --exclude=venv/ --exclude=.git/ --exclude='*.pyc' $(SELF_DIR)/* --delete core@$$host:/home/core/share; done
    33  endef
    34  
    35  define echo_cyan
    36    @echo "\033[0;36m$(subst ",,$(1))\033[0m"
    37  endef
    38  
    39  define echo_yellow
    40    @echo "\033[0;33m$(subst ",,$(1))\033[0m"
    41  endef
    42  
    43  SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
    44  ROUTER_UNITS = $(shell seq -f "deis-router@%g.service" -s " " $(DEIS_FIRST_ROUTER) 1 $(DEIS_LAST_ROUTER))
    45  
    46  check-fleet:
    47  	@LOCAL_VERSION=`$(FLEETCTL) -version`; \
    48  	REMOTE_VERSION=`ssh -o StrictHostKeyChecking=no core@$(subst :, -p ,$(FLEETCTL_TUNNEL)) fleetctl -version`; \
    49  	if [ "$$LOCAL_VERSION" != "$$REMOTE_VERSION" ]; then \
    50  		echo "Your fleetctl client version should match the server. Local version: $$LOCAL_VERSION, server version: $$REMOTE_VERSION. Install the appropriate version from https://github.com/coreos/fleet/releases"; exit 1; \
    51  	fi