| Dean Troyer | f3d5233 | 2015-03-28 10:14:47 -0500 | [diff] [blame] | 1 | # DevStack Makefile of Sanity | 
 | 2 |  | 
 | 3 | # Interesting targets: | 
 | 4 | # ds-remote - Create a Git remote for use by ds-push and ds-pull targets | 
 | 5 | #             DS_REMOTE_URL must be set on the command line | 
 | 6 | # | 
 | 7 | # ds-push - Merge a list of branches taken from .ds-test and push them | 
 | 8 | #           to the ds-remote repo in ds-test branch | 
 | 9 | # | 
 | 10 | # ds-pull - Pull the remote ds-test branch into a fresh local branch | 
 | 11 | # | 
 | 12 | # refresh - Performs a sequence of unstack, refresh and stack | 
 | 13 |  | 
 | 14 | # Duplicated from stackrc for now | 
 | 15 | DEST=/opt/stack | 
 | 16 | WHEELHOUSE=$(DEST)/.wheelhouse | 
 | 17 |  | 
 | 18 | all: | 
 | 19 | 	echo "This just saved you from a terrible mistake!" | 
 | 20 |  | 
 | 21 | # Do Some Work | 
 | 22 | stack: | 
 | 23 | 	./stack.sh | 
 | 24 |  | 
 | 25 | unstack: | 
 | 26 | 	./unstack.sh | 
 | 27 |  | 
 | 28 | wheels: | 
 | 29 | 	WHEELHOUSE=$(WHEELHOUSE) tools/build-wheels.sh | 
 | 30 |  | 
 | 31 | docs: | 
 | 32 | 	tox -edocs | 
 | 33 |  | 
 | 34 | # Just run the shocco source formatting build | 
 | 35 | docs-build: | 
 | 36 | 	INSTALL_SHOCCO=True tools/build_docs.sh | 
 | 37 |  | 
 | 38 | # Just run the Sphinx docs build | 
 | 39 | docs-rst: | 
 | 40 | 	python setup.py build_sphinx | 
 | 41 |  | 
 | 42 | # Run the bashate test | 
 | 43 | bashate: | 
 | 44 | 	tox -ebashate | 
 | 45 |  | 
 | 46 | # Run the function tests | 
 | 47 | test: | 
 | 48 | 	tests/test_ini_config.sh | 
 | 49 | 	tests/test_meta_config.sh | 
 | 50 | 	tests/test_ip.sh | 
 | 51 | 	tests/test_refs.sh | 
 | 52 |  | 
 | 53 | # Spiff up the place a bit | 
 | 54 | clean: | 
 | 55 | 	./clean.sh | 
 | 56 | 	rm -rf accrc doc/build test*-e *.egg-info | 
 | 57 |  | 
 | 58 | # Clean out the cache too | 
 | 59 | realclean: clean | 
 | 60 | 	rm -rf files/cirros*.tar.gz files/Fedora*.qcow2 $(WHEELHOUSE) | 
 | 61 |  | 
 | 62 | # Repo stuffs | 
 | 63 |  | 
 | 64 | pull: | 
 | 65 | 	git pull | 
 | 66 |  | 
 | 67 |  | 
 | 68 | # These repo targets are used to maintain a branch in a remote repo that | 
 | 69 | # consists of one or more local branches merged and pushed to the remote. | 
 | 70 | # This is most useful for iterative testing on multiple or remote servers | 
 | 71 | # while keeping the working repo local. | 
 | 72 | # | 
 | 73 | # It requires: | 
 | 74 | # * a remote pointing to a remote repo, often GitHub is used for this | 
 | 75 | # * a branch name to be used on the remote | 
 | 76 | # * a local file containing the list of local branches to be merged into | 
 | 77 | #   the remote branch | 
 | 78 |  | 
 | 79 | GIT_REMOTE_NAME=ds-test | 
 | 80 | GIT_REMOTE_BRANCH=ds-test | 
 | 81 |  | 
 | 82 | # Push the current branch to a remote named ds-test | 
 | 83 | ds-push: | 
 | 84 | 	git checkout master | 
 | 85 | 	git branch -D $(GIT_REMOTE_BRANCH) || true | 
 | 86 | 	git checkout -b $(GIT_REMOTE_BRANCH) | 
 | 87 | 	for i in $(shell cat .$(GIT_REMOTE_BRANCH) | grep -v "^#" | grep "[^ ]"); do \ | 
 | 88 | 	  git merge --no-edit $$i; \ | 
 | 89 | 	done | 
 | 90 | 	git push -f $(GIT_REMOTE_NAME) HEAD:$(GIT_REMOTE_BRANCH) | 
 | 91 |  | 
 | 92 | # Pull the ds-test branch | 
 | 93 | ds-pull: | 
 | 94 | 	git checkout master | 
 | 95 | 	git branch -D $(GIT_REMOTE_BRANCH) || true | 
 | 96 | 	git pull $(GIT_REMOTE_NAME) $(GIT_REMOTE_BRANCH) | 
 | 97 | 	git checkout $(GIT_REMOTE_BRANCH) | 
 | 98 |  | 
 | 99 | # Add the remote - set DS_REMOTE_URL=htps://example.com/ on the command line | 
 | 100 | ds-remote: | 
 | 101 | 	git remote add $(GIT_REMOTE_NAME) $(DS_REMOTE_URL) | 
 | 102 |  | 
 | 103 | # Refresh the current DevStack checkout nd re-initialize | 
 | 104 | refresh: unstack ds-pull stack |