forked from chef-boneyard/opscode-omnibus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (61 loc) · 2.59 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
# These targets are intended to run from a developer workstation, not
# an Omnibus build node. If you want to muck about on the build node
# itself, please use the `build_node.mk` file instead.
#
# e.g., 'make -f build_node.mk $TARGET'
DEV_PLATFORM ?= ubuntu-1004
DEV_PROJECT=opscode-omnibus
.DEFAULT_GOAL=dev
dev:
kitchen converge default-$(DEV_PLATFORM)
dev-login:
kitchen login default-$(DEV_PLATFORM)
dev-destroy:
kitchen destroy default-$(DEV_PLATFORM)
dev-suspend:
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) \
&& vagrant suspend
dev-resume:
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) \
&& vagrant resume
from_scratch: dev-destroy dev
update-omnibus:
bundle update omnibus
update-omnibus-software:
bundle update omnibus-software
update:
bundle update omnibus omnibus-software
extract_dev_cache:
mkdir -p $(DEV_PLATFORM)_git_cache
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) \
&& vagrant ssh -c 'cp -R /var/cache/omnibus/cache/git_cache /home/vagrant/$(DEV_PROJECT)/$(DEV_PLATFORM)_git_cache'
deploy_dev_cache:
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) \
&& vagrant ssh -c 'mkdir -p /var/cache/omnibus/cache && rm -rf /var/cache/omnibus/cache/* && cp -R /home/vagrant/$(DEV_PROJECT)/$(DEV_PLATFORM)_git_cache/* /var/cache/omnibus/cache'
# Remove all but the most recent installer package (and its metadata
# file) from the pkg directory. This is used to keep the pkg
# directory small, as it is rsynced into our development Vagrant box
# (see
# https://github.com/opscode/delivery/blob/master/cookbooks/delivery-dev/recipes/delivery.rb)
#
# "tail -n+2" starts the listing at the second line (i.e., we don't
# send the most recent file through to the "rm")
#
# Note that "prune" is synonymous with "prune_deb", as Ubuntu is the
# platform we currently target in development; this is the target that
# you'll use on a regular basis. "prune_rpm" is provided for
# completeness, should you ever create CentOS installers.
prune: prune_deb
clear_pkg_cache: clear_pkg_cache_deb
clear_pkg_cache_%:
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) \
&& vagrant ssh -c 'rm -v -f /var/cache/omnibus/pkg/*.$*'
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) \
&& vagrant ssh -c 'rm -v -f /var/cache/omnibus/pkg/*.$*.metadata.json'
prune_%:
ls -1t pkg/*.$* | tail -n+2 | xargs rm -v
ls -1t pkg/*.$*.metadata.json | tail -n+2 | xargs rm -v
# Bundle install and build chef-server
dev-build: clear_pkg_cache prune
cd .kitchen/kitchen-vagrant/default-$(DEV_PLATFORM) && \
vagrant ssh --command "cd opscode-omnibus && bundle install && time ./bin/omnibus build chef-server"