Last active
December 12, 2015 01:49
-
-
Save whiteinge/4694319 to your computer and use it in GitHub Desktop.
A Makefile to help with Salt development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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