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