blob: 970d8009ebe4c6081f854a09fa63ad8cdaf92813 [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
Dean Troyerf3d52332015-03-28 10:14:47 -050016
17all:
Sachin Patilaac43e12016-04-30 14:01:38 +053018 @echo "This just saved you from a terrible mistake!"
Dean Troyerf3d52332015-03-28 10:14:47 -050019
20# Do Some Work
21stack:
22 ./stack.sh
23
24unstack:
25 ./unstack.sh
26
Dean Troyerf3d52332015-03-28 10:14:47 -050027docs:
28 tox -edocs
29
30# Just run the shocco source formatting build
31docs-build:
32 INSTALL_SHOCCO=True tools/build_docs.sh
33
34# Just run the Sphinx docs build
35docs-rst:
36 python setup.py build_sphinx
37
38# Run the bashate test
39bashate:
40 tox -ebashate
41
42# Run the function tests
43test:
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
50clean:
51 ./clean.sh
52 rm -rf accrc doc/build test*-e *.egg-info
53
54# Clean out the cache too
55realclean: clean
Sean Dague9013bb02015-11-04 12:31:39 -050056 rm -rf files/cirros*.tar.gz files/Fedora*.qcow2
Dean Troyerf3d52332015-03-28 10:14:47 -050057
58# Repo stuffs
59
60pull:
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
75GIT_REMOTE_NAME=ds-test
76GIT_REMOTE_BRANCH=ds-test
77
78# Push the current branch to a remote named ds-test
79ds-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
89ds-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
96ds-remote:
97 git remote add $(GIT_REMOTE_NAME) $(DS_REMOTE_URL)
98
99# Refresh the current DevStack checkout nd re-initialize
100refresh: unstack ds-pull stack