-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathMakefile
More file actions
146 lines (113 loc) · 7.88 KB
/
Makefile
File metadata and controls
146 lines (113 loc) · 7.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
TEST_INVENTORY ?= tests/inventory.yaml
TEST_VARS ?= tests/vars.yaml
TEST_CEPH_OVERRIDES ?= tests/ceph_overrides.yaml
TEST_SECRETS ?= tests/secrets.yaml
TEST_CONFIG ?= tests/ansible.cfg
TEST_ARGS ?=
##@ General
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ TESTS
test-minimal: TEST_OUTFILE ?= tests/logs/test_minimal_out_$(shell date +%FT%T%Z).log
test-minimal: ## Launch minimal test suite
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_minimal.yaml 2>&1 | tee $(TEST_OUTFILE)
test_ospdo_controlplane: TEST_OUTFILE ?= tests/logs/test_minimal_out_$(shell date +%FT%T%Z).log
test_ospdo_controlplane:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e ospdo_src=True --skip-tags "pull_openstack_configuration,dataplane_adoption" -e @$(TEST_SECRETS) -e @$(TEST_VARS) tests/playbooks/test_minimal.yaml 2>&1 | tee $(TEST_OUTFILE)
test_ospdo_dataplane: TEST_OUTFILE ?= tests/logs/test_minimal_out_$(shell date +%FT%T%Z).log
test_ospdo_dataplane:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e ospdo_src=True --tags "pull_openstack_configuration,dataplane_adoption" -e @$(TEST_SECRETS) -e @$(TEST_VARS) tests/playbooks/test_minimal.yaml 2>&1 | tee $(TEST_OUTFILE)
test-with-ceph: TEST_OUTFILE ?= tests/logs/test_with_ceph_out_$(shell date +%FT%T%Z).log
test-with-ceph: ## Launch test suite with ceph
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_with_ceph.yaml 2>&1 | tee $(TEST_OUTFILE)
test-with-ceph-and-ironic: TEST_OUTFILE ?= tests/logs/test_with_ceph_and_ironic_out_$(shell date +%FT%T%Z).log
test-with-ceph-and-ironic: ## Launch test suite with ceph and ironic
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_with_ceph_and_ironic.yaml 2>&1 | tee $(TEST_OUTFILE)
test-tripleo-requirements: TEST_OUTFILE ?= tests/logs/test_tripleo_requirements_out_$(shell date +%FT%T%Z).log
test-tripleo-requirements: ## Launch test suite related to the ceph migration
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_VARS) -e @$(TEST_CEPH_OVERRIDES) -e @$(TEST_SECRETS) $(TEST_ARGS) tests/playbooks/test_tripleo_adoption_requirements.yaml 2>&1 | tee $(TEST_OUTFILE)
test-ceph-migration: TEST_OUTFILE ?= tests/logs/test_ceph_migration_out_$(shell date +%FT%T%Z).log
test-ceph-migration: ## Launch test suite related to the ceph migration
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_VARS) -e @$(TEST_CEPH_OVERRIDES) -e @$(TEST_SECRETS) $(TEST_ARGS) tests/playbooks/test_externalize_ceph.yaml 2>&1 | tee $(TEST_OUTFILE)
test-swift-migration: TEST_OUTFILE ?= tests/logs/test_swift_migration_out_$(shell date +%FT%T%Z).log
test-swift-migration:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_swift_migration.yaml 2>&1 | tee $(TEST_OUTFILE)
test-swift-conversion: TEST_OUTFILE ?= tests/logs/test_swift_conversion_out_$(shell date +%FT%T%Z).log
test-swift-conversion:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_swift_conversion.yaml 2>&1 | tee $(TEST_OUTFILE)
test-ocp-as-gw: TEST_OUTFILE ?= tests/logs/test_ocp_as_gw_out_$(shell date +%FT%T%Z).log
test-ocp-as-gw: ## Launch test suite related to the ocp gateways
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_ocp_as_gw.yaml 2>&1 | tee $(TEST_OUTFILE)
test-rollback-minimal: TEST_OUTFILE ?= tests/logs/test_rollback_minimal_out_$(shell date +%FT%T%Z).log
test-rollback-minimal:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_rollback_minimal.yaml 2>&1 | tee $(TEST_OUTFILE)
test-rollback-with-ceph: TEST_OUTFILE ?= tests/logs/test_rollback_with_ceph_out_$(shell date +%FT%T%Z).log
test-rollback-with-ceph:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_rollback_with_ceph.yaml 2>&1 | tee $(TEST_OUTFILE)
#To run playbook that only runs control_plane_rollback role.
test-rollback-only-minimal: TEST_OUTFILE ?= tests/logs/test_rollback_only_minimal_out_$(shell date +%FT%T%Z).log
test-rollback-only-minimal:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_rollback_minimal.yaml --tag=control_plane_rollback 2>&1 | tee $(TEST_OUTFILE)
test-rollback-only-with-ceph: TEST_OUTFILE ?= tests/logs/test_rollback_only_with_ceph_out_$(shell date +%FT%T%Z).log
test-rollback-only-with-ceph:
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_rollback_with_ceph.yaml --tag=control_plane_rollback 2>&1 | tee $(TEST_OUTFILE)
test-with-ironic: TEST_OUTFILE ?= tests/logs/test_with_ironic_out_$(shell date +%FT%T%Z).log
test-with-ironic: ## Launch test suite with Ironic
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/test_with_ironic.yaml 2>&1 | tee $(TEST_OUTFILE)
test-configure-object: TEST_OUTFILE ?= tests/logs/test_configure_object_out_$(shell date +%FT%T%Z).log
test-configure-object: ## Configure Swift object store to use Ceph RGW
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/configure_swift_rgw.yaml 2>&1 | tee $(TEST_OUTFILE)
##@ DOCS
docs-dependencies: .bundle
.bundle: ## Attempt to install bundle
if ! type bundle; then \
echo "Bundler not found. On Linux run 'sudo dnf install /usr/bin/bundle' to install it."; \
exit 1; \
fi
bundle config set --local path 'local/bundle'; bundle install
docs: docs-dependencies docs-user-all-variants docs-dev ## Build documentation
docs-user-all-variants:
cd docs_user; BUILD=upstream $(MAKE) html
cd docs_user; BUILD=downstream $(MAKE) html
cd docs_user; BUILD=downstream BUILD_VARIANT=ospdo $(MAKE) html
docs-user:
cd docs_user; $(MAKE) html
docs-user-open:
cd docs_user; $(MAKE) open-html
docs-user-watch:
cd docs_user; $(MAKE) watch-html
docs-dev:
cd docs_dev; $(MAKE) html
docs-dev-open:
cd docs_dev; $(MAKE) open-html
docs-dev-watch:
cd docs_dev; $(MAKE) watch-html
docs-clean: ## Cleanup documentation
rm -r docs_build