blob: 082aff21d22cac6e00a22d2c160d045facb71ca3 [file] [log] [blame]
Dean Troyerf3d52332015-03-28 10:14:47 -05001# 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
15DEST=/opt/stack
16WHEELHOUSE=$(DEST)/.wheelhouse
17
18all:
19 echo "This just saved you from a terrible mistake!"
20
21# Do Some Work
22stack:
23 ./stack.sh
24
25unstack:
26 ./unstack.sh
27
28wheels:
29 WHEELHOUSE=$(WHEELHOUSE) tools/build-wheels.sh
30
31docs:
32 tox -edocs
33
34# Just run the shocco source formatting build
35docs-build:
36 INSTALL_SHOCCO=True tools/build_docs.sh
37
38# Just run the Sphinx docs build
39docs-rst:
40 python setup.py build_sphinx
41
42# Run the bashate test
43bashate:
44 tox -ebashate
45
46# Run the function tests
47test:
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
54clean:
55 ./clean.sh
56 rm -rf accrc doc/build test*-e *.egg-info
57
58# Clean out the cache too
59realclean: clean
60 rm -rf files/cirros*.tar.gz files/Fedora*.qcow2 $(WHEELHOUSE)
61
62# Repo stuffs
63
64pull:
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
79GIT_REMOTE_NAME=ds-test
80GIT_REMOTE_BRANCH=ds-test
81
82# Push the current branch to a remote named ds-test
83ds-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
93ds-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
100ds-remote:
101 git remote add $(GIT_REMOTE_NAME) $(DS_REMOTE_URL)
102
103# Refresh the current DevStack checkout nd re-initialize
104refresh: unstack ds-pull stack