forked from datasmid/buildserver
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
118 lines (95 loc) · 3.27 KB
/
Makefile
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
VAGRANT_DEFAULT_PROVIDER=virtualbox
export ANSIBLE_SSH_ARGS='-o ControlMaster=no'
export PYCURL_SSL_LIBRARY=openssl
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
default: help
.PHONY: help
help:
@echo "Beginner tasks:"
@echo "make galaxy_roles -install requirements"
@echo "make trust -generate keys"
@echo "make myself -install locally on centos7"
@echo "make vagrant -Install 2 vagrant virtual machines"
@echo "make install -Build the build_master from a Mac, and install docker on centos7"
# @echo "make deploy -Deploy the application game of life to target"
@echo "make cleanroles -Cleanup vm's and ansible roles"
.venv:
@echo Install a python3 venv.
python3 -m venv .venv
( . .venv/bin/activate && pip3 install --upgrade --ignore-installed -r requirements.txt )
.PHONY: galaxy_roles
galaxy_roles:
@echo Install Ansible galaxy roles.
ansible-galaxy install -p ./galaxy_roles --force --role-file requirements.yml
files/ca-certificates/internal_ca.cer: .venv
@( . .venv/bin/activate && ./trust_me.yml )
.PHONY: trust
trust: files/ca-certificates/internal_ca.cer
install: .venv galaxy_roles files/ca-certificates/internal_ca.cer .vagrant
vagrant up --no-provision centos7
( . .venv/bin/activate && ansible-playbook -l centos7 playbook.yml -vv ) || /usr/bin/true
vagrant up --no-provision build_master
vagrant provision build_master
.PHONY: provision
provision:
vagrant provision build_master
.PHONY: myself
myself: .venv
( . .venv/bin/activate && ansible-playbook -b -K -i inventories/local -l build provision.yml -vv )
.PHONY: addboxes
addboxes:
vagrant box add -f -name win_slave boxes/windows.box
.PHONY: vagrant
vagrant:
@echo Bring up vagrant VM:** 'build_master' the CI server
vagrant up --no-provision build_master centos7
vagrant provision build_master
.vagrant:
@echo Bring up vagrant VM:** 'build_master' the CI server
vagrant up --no-provision build_master
vagrant provision build_master
.PHONY: build
build:
@echo Triggers build jobs Jenkins on [build_master].
( . .venv/bin/activate && ansible-playbook -vv -l build_master build.yml )
.PHONY: cleanroles
cleanroles:
rm -rf galaxy_roles
.PHONY: destroy
destroy:
@echo halt virtual machine
vagrant halt build_master
vagrant halt win_slave
@echo Destroys virtual machines
vagrant destroy -f build_master
vagrant destroy -f win_slave
.PHONY: clean
clean: cleanroles destroy
.PHONY: deploy
deploy:
( . .venv/bin/activate && ansible-playbook -vv -l target deploy.yml )
.PHONY: smoketest
smoketest:
( . .venv/bin/activate && ansible-playbook -vv -l build_master:target smoketest.yml )
.PHONY: webtest
webtest:
( . .venv/bin/activate && ansible-playbook -vv -l target webtest.yml )
.PHONY: test
test: smoketest webtest
.PHONY: all
all: clean setup install deploy
build.box:
vagrant halt build_master
vagrant package --base build_master --output boxes/build.box
boxes/target.box:
vagrant halt target
vagrant package --base target --output boxes/target.box
boxes/test.box:
vagrant halt test_slave
vagrant package --base test_slave --output boxes/test.box
boxes/windows.box:
vagrant halt win_slave
vagrant package --base win_slave --output boxes/windows.box
.PHONY: boxes
boxes: boxes/build.box boxes/target.box boxes/test.box boxes/windows.box