commit
071827338d
1 changed files with 14 additions and 11 deletions
25
Makefile
25
Makefile
|
@ -2,6 +2,9 @@ UBUNTU_BOXES= precise quantal raring saucy trusty
|
||||||
DEBIAN_BOXES= squeeze wheezy sid jessie
|
DEBIAN_BOXES= squeeze wheezy sid jessie
|
||||||
TODAY=$(shell date -u +"%Y-%m-%d")
|
TODAY=$(shell date -u +"%Y-%m-%d")
|
||||||
|
|
||||||
|
# Replace i686 with i386
|
||||||
|
ARCH=$(shell uname -m | sed -e "s/68/38/")
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
all: ubuntu debian
|
all: ubuntu debian
|
||||||
|
@ -10,26 +13,26 @@ ubuntu: $(UBUNTU_BOXES)
|
||||||
debian: $(DEBIAN_BOXES)
|
debian: $(DEBIAN_BOXES)
|
||||||
|
|
||||||
# REFACTOR: Figure out how can we reduce duplicated code
|
# REFACTOR: Figure out how can we reduce duplicated code
|
||||||
$(UBUNTU_BOXES): CONTAINER = "vagrant-base-${@}-amd64"
|
$(UBUNTU_BOXES): CONTAINER = "vagrant-base-${@}-$(ARCH)"
|
||||||
$(UBUNTU_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-amd64.box"
|
$(UBUNTU_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-$(ARCH).box"
|
||||||
$(UBUNTU_BOXES):
|
$(UBUNTU_BOXES):
|
||||||
@mkdir -p $$(dirname $(PACKAGE))
|
@mkdir -p $$(dirname $(PACKAGE))
|
||||||
@sudo -E ./mk-debian.sh ubuntu $(@) amd64 $(CONTAINER) $(PACKAGE)
|
@sudo -E ./mk-debian.sh ubuntu $(@) $(ARCH) $(CONTAINER) $(PACKAGE)
|
||||||
@sudo chmod +rw $(PACKAGE)
|
@sudo chmod +rw $(PACKAGE)
|
||||||
@sudo chown ${USER}: $(PACKAGE)
|
@sudo chown ${USER}: $(PACKAGE)
|
||||||
$(DEBIAN_BOXES): CONTAINER = "vagrant-base-${@}-amd64"
|
$(DEBIAN_BOXES): CONTAINER = "vagrant-base-${@}-$(ARCH)"
|
||||||
$(DEBIAN_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-amd64.box"
|
$(DEBIAN_BOXES): PACKAGE = "output/${TODAY}/vagrant-lxc-${@}-$(ARCH).box"
|
||||||
$(DEBIAN_BOXES):
|
$(DEBIAN_BOXES):
|
||||||
@mkdir -p $$(dirname $(PACKAGE))
|
@mkdir -p $$(dirname $(PACKAGE))
|
||||||
@sudo -E ./mk-debian.sh debian $(@) amd64 $(CONTAINER) $(PACKAGE)
|
@sudo -E ./mk-debian.sh debian $(@) $(ARCH) $(CONTAINER) $(PACKAGE)
|
||||||
@sudo chmod +rw $(PACKAGE)
|
@sudo chmod +rw $(PACKAGE)
|
||||||
@sudo chown ${USER}: $(PACKAGE)
|
@sudo chown ${USER}: $(PACKAGE)
|
||||||
|
|
||||||
acceptance: CONTAINER = "vagrant-base-acceptance-amd64"
|
acceptance: CONTAINER = "vagrant-base-acceptance-$(ARCH)"
|
||||||
acceptance: PACKAGE = "output/${TODAY}/vagrant-lxc-acceptance-amd64.box"
|
acceptance: PACKAGE = "output/${TODAY}/vagrant-lxc-acceptance-$(ARCH).box"
|
||||||
acceptance:
|
acceptance:
|
||||||
@mkdir -p $$(dirname $(PACKAGE))
|
@mkdir -p $$(dirname $(PACKAGE))
|
||||||
@PUPPET=1 CHEF=1 sudo -E ./mk-debian.sh ubuntu precise amd64 $(CONTAINER) $(PACKAGE)
|
@PUPPET=1 CHEF=1 sudo -E ./mk-debian.sh ubuntu precise $(ARCH) $(CONTAINER) $(PACKAGE)
|
||||||
@sudo chmod +rw $(PACKAGE)
|
@sudo chmod +rw $(PACKAGE)
|
||||||
@sudo chown ${USER}: $(PACKAGE)
|
@sudo chown ${USER}: $(PACKAGE)
|
||||||
|
|
||||||
|
@ -37,6 +40,6 @@ clean: ALL_BOXES = ${DEBIAN_BOXES} ${UBUNTU_BOXES} acceptance
|
||||||
clean:
|
clean:
|
||||||
@for r in $(ALL_BOXES); do \
|
@for r in $(ALL_BOXES); do \
|
||||||
sudo -E ./clean.sh $${r}\
|
sudo -E ./clean.sh $${r}\
|
||||||
vagrant-base-$${r}-amd64 \
|
vagrant-base-$${r}-$(ARCH) \
|
||||||
output/${TODAY}/vagrant-lxc-$${r}-amd64.box; \
|
output/${TODAY}/vagrant-lxc-$${r}-$(ARCH).box; \
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue