summaryrefslogtreecommitdiffstats
path: root/vagrant/puppet/modules/Makefile
blob: c6507733a245c65df95827a609bd68d053523b90 (plain)
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
# Makefile for pulling in git modules for Vagrant deployment for Puppet-Gluster
# Copyright (C) 2010-2013+ James Shubin
# Written by James Shubin <james@shubin.ca>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# NOTE: if we remove a module, it won't get purged from the destination!

# NOTE: this script can sync puppet-gluster to a specific sha1sum commit, or it
# can sync all of the repos to git master. This option can be useful for devel.

BASE = 'https://github.com/purpleidea'
MODULES := \
	puppet-common \
	puppet-gluster \
	puppet-keepalived \
	puppet-module-data \
	puppet-puppet \
	puppet-shorewall \
	puppet-yum \
	puppetlabs-apt \
	puppetlabs-stdlib
# NOTE: set to a git commit id if we need an specific commit for vagrant builds
# NOTE: remember that new commits to master should change this to a specific id
# if they will break the vagrant build process. hopefully we don't forget this!
#SHA1SUM := master
SHA1SUM := $(shell git rev-parse --verify HEAD)	# goto whatever the main tree is at

.PHONY: all modules gluster
.SILENT: all modules gluster

all:

#
#	modules
#
# clone, and then pull
modules:
	basename `pwd` | grep -q '^modules' || exit 1	# run in a modules dir!
	for i in $(MODULES); do \
		j=`echo $$i | awk -F '-' '{print $$2}'`; \
		[ -d "$$j" ] || git clone --depth 1 $(BASE)/$$i.git $$j; \
		[ -d "$$j" ] && cd $$j && git pull; cd ..; \
	done

#
#	gluster
#
# just clone and pull this one
gluster:
	basename `pwd` | grep -q '^modules' || exit 1	# run in a modules dir!
	i='puppet-gluster'; \
	j=`echo $$i | awk -F '-' '{print $$2}'`; \
	[ -d "$$j" ] || git clone ../../../. $$j; \
	[ -d "$$j" ] && cd $$j && git checkout master && git pull && git checkout $(SHA1SUM); cd ..