vagrant-lxc-base-boxes/Makefile

70 lines
2.5 KiB
Makefile
Raw Normal View History

2016-03-12 20:01:32 +00:00
UBUNTU_BOXES= precise quantal raring saucy trusty utopic vivid wily xenial
2016-06-27 12:07:22 +00:00
DEBIAN_BOXES= squeeze wheezy jessie stretch sid
2016-08-15 02:43:55 +00:00
CENTOS_BOXES= 6 7
FEDORA_BOXES= rawhide 23 22 21 20 19
2014-03-25 03:26:19 +00:00
TODAY=$(shell date -u +"%Y-%m-%d")
2014-05-03 14:34:38 +00:00
# Replace i686 with i386 and x86_64 with amd64
ARCH=$(shell uname -m | sed -e "s/68/38/" | sed -e "s/x86_64/amd64/")
2014-04-28 01:31:23 +00:00
2014-03-25 03:26:19 +00:00
default:
all: ubuntu debian fedora
2014-03-25 03:26:19 +00:00
ubuntu: $(UBUNTU_BOXES)
debian: $(DEBIAN_BOXES)
2014-09-24 15:16:20 +00:00
centos: $(CENTOS_BOXES)
fedora: $(FEDORA_BOXES)
2014-03-25 03:26:19 +00:00
# REFACTOR: Figure out how can we reduce duplicated code
2014-04-28 01:31:23 +00:00
$(UBUNTU_BOXES): CONTAINER = "vagrant-base-${@}-$(ARCH)"
$(UBUNTU_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-$(ARCH).box"
2014-03-25 03:26:19 +00:00
$(UBUNTU_BOXES):
@mkdir -p $$(dirname $(PACKAGE))
2014-04-28 01:31:23 +00:00
@sudo -E ./mk-debian.sh ubuntu $(@) $(ARCH) $(CONTAINER) $(PACKAGE)
2014-03-25 03:26:19 +00:00
@sudo chmod +rw $(PACKAGE)
@sudo chown ${USER}: $(PACKAGE)
2014-04-28 01:31:23 +00:00
$(DEBIAN_BOXES): CONTAINER = "vagrant-base-${@}-$(ARCH)"
$(DEBIAN_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-$(ARCH).box"
2014-03-25 03:26:19 +00:00
$(DEBIAN_BOXES):
@mkdir -p $$(dirname $(PACKAGE))
2014-04-28 01:31:23 +00:00
@sudo -E ./mk-debian.sh debian $(@) $(ARCH) $(CONTAINER) $(PACKAGE)
2014-03-25 03:26:19 +00:00
@sudo chmod +rw $(PACKAGE)
@sudo chown ${USER}: $(PACKAGE)
2014-09-24 15:16:20 +00:00
$(CENTOS_BOXES): CONTAINER = "vagrant-base-centos-${@}-$(ARCH)"
$(CENTOS_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-centos-${@}-$(ARCH).box"
$(CENTOS_BOXES):
@mkdir -p $$(dirname $(PACKAGE))
@sudo -E ./mk-centos.sh $(@) $(ARCH) $(CONTAINER) $(PACKAGE)
@sudo chmod +rw $(PACKAGE)
@sudo chown ${USER}: $(PACKAGE)
$(FEDORA_BOXES): CONTAINER = "vagrant-base-fedora-${@}-$(ARCH)"
$(FEDORA_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-fedora-${@}-$(ARCH).box"
$(FEDORA_BOXES):
@mkdir -p $$(dirname $(PACKAGE))
@sudo -E ./mk-fedora.sh $(@) $(ARCH) $(CONTAINER) $(PACKAGE)
@sudo chmod +rw $(PACKAGE)
@sudo chown ${USER}: $(PACKAGE)
2014-03-25 03:26:19 +00:00
2014-04-28 01:31:23 +00:00
acceptance: CONTAINER = "vagrant-base-acceptance-$(ARCH)"
acceptance: PACKAGE = "output/${TODAY}/vagrant-lxc-acceptance-$(ARCH).box"
2014-03-25 03:26:19 +00:00
acceptance:
@mkdir -p $$(dirname $(PACKAGE))
2014-04-28 01:31:23 +00:00
@PUPPET=1 CHEF=1 sudo -E ./mk-debian.sh ubuntu precise $(ARCH) $(CONTAINER) $(PACKAGE)
2014-03-25 03:26:19 +00:00
@sudo chmod +rw $(PACKAGE)
@sudo chown ${USER}: $(PACKAGE)
2014-09-24 15:16:20 +00:00
release:
@test -z '$(version)' && echo 'version parameter not provided to `make`!' && exit 1 || return 0
gh release create -d -a output/${TODAY} $(version)
git tag $(version)
git push && git push --tags
clean: ALL_BOXES = ${DEBIAN_BOXES} ${UBUNTU_BOXES} ${CENTOS_BOXES} ${FEDORA_BOXES} acceptance
2014-03-25 03:26:19 +00:00
clean:
@for r in $(ALL_BOXES); do \
sudo -E ./clean.sh $${r}\
2014-12-23 00:12:09 +00:00
vagrant-base-$${r}-$(ARCH) \
output/${TODAY}/vagrant-lxc-$${r}-$(ARCH).box; \
done