Skip to content

Commit a0a6b38

Browse files
committed
feat(Makefile): move rsync from Vagrantfile to Makefile
Moves rsync from the Vagrantfile to the Makefile, enabling development to occur on non-local Deis deployments (EC2, Rackspace, etc.). TESTING: ensure `make build` works the same way, both for the main Makefile and the individual component Makefiles. To test for a remote deployment: ```console $ DEIS_HOSTS="54.12.21.12 54.13.11.4 55.61.2.4" make build ``` You can also test the `make rsync` target directly. closes #1020
1 parent 9a68bab commit a0a6b38

10 files changed

Lines changed: 15 additions & 6 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ START_UNITS = $(foreach C,$(START_COMPONENTS),$(wildcard $(C)/systemd/*))
2929

3030
all: build run
3131

32-
build:
32+
build: rsync
3333
$(call ssh_all,'cd share && for c in $(ALL_COMPONENTS); do cd $$c && docker build -t deis/$$c . && cd ..; done')
3434

3535
clean: uninstall
@@ -56,6 +56,9 @@ pull:
5656

5757
restart: stop start
5858

59+
rsync:
60+
$(call rsync_all)
61+
5962
run: install start
6063

6164
start: check-fleet start-warning start-routers

Vagrantfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ Vagrant.configure("2") do |config|
4646
ip = "172.17.8.#{i+99}"
4747
config.vm.network :private_network, ip: ip
4848

49-
# FALLBACK Enable NFS for sharing the host machine into the coreos-vagrant VM.
50-
# config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp']
51-
# Note that with rsync, local Deis code changes need to be re-synced to the VM by issuing a `vagrant rsync`
52-
config.vm.synced_folder ".", "/home/core/share", type: "rsync"
53-
5449
# user-data bootstrapping
5550
config.vm.provision :file, :source => "contrib/coreos/user-data", :destination => "/tmp/vagrantfile-user-data"
5651
# check that the CoreOS user-data file is valid

builder/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include ../includes.mk
22

33
build:
4+
$(call rsync_all)
45
$(call ssh_all,'cd share/builder && docker build -t deis/builder .')
56

67
install: check-fleet

cache/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include ../includes.mk
22

33
build:
4+
$(call rsync_all)
45
$(call ssh_all,'cd share/cache && sudo docker build -t deis/cache .')
56

67
install: check-fleet

controller/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include ../includes.mk
55
all: build run
66

77
build:
8+
$(call rsync_all)
89
$(call ssh_all,'cd share/controller && sudo docker build -t deis/controller .')
910

1011
install: check-fleet

database/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include ../includes.mk
22

33
build:
4+
$(call rsync_all)
45
$(call ssh_all,'cd share/database && sudo docker build -t deis/database .')
56

67
install: check-fleet

includes.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ define ssh_all
2828
for host in $(DEIS_HOSTS); do ssh -o LogLevel=FATAL -o Compression=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PasswordAuthentication=no core@$$host -t $(1); done
2929
endef
3030

31+
define rsync_all
32+
for host in $(DEIS_HOSTS); do rsync -Pave "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --exclude=docs/ --exclude=htmlcov/ --exclude=logs/ --exclude=venv/ --exclude=.git/ --exclude='*.pyc' $(shell pwd)/* core@$$host:/home/core/share; done
33+
endef
34+
3135
define echo_cyan
3236
@echo "\033[0;36m$(subst ",,$(1))\033[0m"
3337
endef

logger/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include ../includes.mk
22

33
build:
4+
$(call rsync_all)
45
$(call ssh_all,'cd share/logger && sudo docker build -t deis/logger .')
56

67
install: check-fleet

registry/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include ../includes.mk
22

33
build:
4+
$(call rsync_all)
45
$(call ssh_all,'cd share/registry && sudo docker build -t deis/registry .')
56

67
install: check-fleet

router/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include ../includes.mk
22

33
build:
4+
$(call rsync_all)
45
$(call ssh_all,'cd share/router && sudo docker build -t deis/router .')
56

67
install: check-fleet

0 commit comments

Comments
 (0)