Skip to content

Instantly share code, notes, and snippets.

@whiteinge
Last active December 12, 2015 01:49
Show Gist options
  • Save whiteinge/4694319 to your computer and use it in GitHub Desktop.
Save whiteinge/4694319 to your computer and use it in GitHub Desktop.
A Makefile to help with Salt development
# Easily install, maintain, and cleanly reset (!) a Salt development
# installation inside a virtualenv (no need to "activate" the venv)
SRC := /home/shouse/src/salt/salt
VENV := /home/shouse/tmp/venvs/salt
BIN := $(VENV)/bin
ETC := $(VENV)/etc/salt
PKI := $(ETC)/pki
VAR := $(VENV)/var
TMP := $(VENV)/tmp
SWMROOT := /tmp/ms-tmp
DEBUG :=
all: master minion api
help:
@echo "Start all the services listed in the 'all' target"
@echo "by specifying a high enough number of jobs to run."
@echo "E.g., make -f Makedev -j 5"
@echo "Change the logging level with: DEBUG='-l debug'"
@echo
@echo "Full example:"
@echo "make -f $$HOME/src/salt/Makedev -j 6 DEBUG='-l debug' master minion api swarm"
master:
$(BIN)/salt-master -c $(ETC) $(DEBUG)
minion:
$(BIN)/salt-minion -c $(ETC) $(DEBUG)
swarm:
PATH="$(BIN):$$PATH" $(BIN)/python $(SRC)/tests/minionswarm.py -c $(ETC) --master=localhost --root-dir=$(SWMROOT)
api:
$(BIN)/salt-api -c $(ETC) $(DEBUG)
clean:
-rm -rf $(PKI)
-rm -rf $(VAR)
-rm -rf $(TMP)
-rm -rf $(SWMROOT)
-mkdir -p $(SWMROOT)/{tmp,var}
-find $(SRC) -name '*.pyc' -delete
# vim:ft=make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment