-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
59 lines (44 loc) · 2.28 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
BOX_OUTPUT_PATH ?= box/virtualbox
SERVER_BUILD_VERSION ?= 1.3.0
SERVER_VM_NAME ?= juicebox-server
SERVER_BUILD_NAME ?= $(SERVER_VM_NAME)-$(SERVER_BUILD_VERSION)
SERVER_BOX_NAME ?= $(SERVER_BUILD_NAME).box
SERVER_BOX_PATH ?= $(BOX_OUTPUT_PATH)/$(SERVER_BOX_NAME)
SERVER_OVA_NAME ?= $(SERVER_BUILD_NAME).ova
SERVER_OUTPUT_PATH ?= output-$(SERVER_VM_NAME)
SERVER_OVA_PATH ?= $(SERVER_OUTPUT_PATH)/$(SERVER_OVA_NAME)
DESKTOP_BUILD_VERSION ?= 1.3.0
DESKTOP_VM_NAME ?= juicebox-desktop
DESKTOP_BUILD_NAME ?= $(DESKTOP_VM_NAME)-$(DESKTOP_BUILD_VERSION)
DESKTOP_BOX_NAME ?= $(DESKTOP_BUILD_NAME).box
DESKTOP_BOX_PATH ?= $(BOX_OUTPUT_PATH)/$(DESKTOP_BOX_NAME)
DESKTOP_OVA_NAME ?= $(DESKTOP_BUILD_NAME).ova
DESKTOP_OUTPUT_PATH ?= output-$(DESKTOP_VM_NAME)
DESKTOP_OVA_PATH ?= $(DESKTOP_OUTPUT_PATH)/$(DESKTOP_OVA_NAME)
BUCKET_NAME ?= io-blimp-juicebox
server:
packer build server.json
cd $(SERVER_OUTPUT_PATH) && zip -X $(SERVER_OVA_NAME).zip $(SERVER_OVA_NAME)
cd $(BOX_OUTPUT_PATH) && zip -X $(SERVER_BOX_NAME).zip $(SERVER_BOX_NAME)
desktop:
packer build desktop.json
cd $(DESKTOP_OUTPUT_PATH) && zip -X $(DESKTOP_OVA_NAME).zip $(DESKTOP_OVA_NAME)
cd $(BOX_OUTPUT_PATH) && zip -X $(DESKTOP_BOX_NAME).zip $(DESKTOP_BOX_NAME)
clean: clean/server clean/desktop
clean/server:
rm -rf $(SERVER_OUTPUT_PATH) $(SERVER_BOX_PATH)
clean/desktop:
rm -rf $(DESKTOP_OUTPUT_PATH) $(DESKTOP_BOX_PATH)
upload: upload/server/ova upload/desktop/ova
upload/server:
s3cmd --access_key=$(AWS_ACCESS_KEY_ID) --secret_key=$(AWS_SECRET_ACCESS_KEY) put $(SERVER_BOX_PATH) $(SERVER_OVA_PATH) s3://$(BUCKET_NAME)/
upload/server/box:
s3cmd --access_key=$(AWS_ACCESS_KEY_ID) --secret_key=$(AWS_SECRET_ACCESS_KEY) put $(SERVER_BOX_PATH) s3://$(BUCKET_NAME)/
upload/server/ova:
s3cmd --access_key=$(AWS_ACCESS_KEY_ID) --secret_key=$(AWS_SECRET_ACCESS_KEY) put $(SERVER_OVA_PATH) s3://$(BUCKET_NAME)/
upload/desktop:
s3cmd --access_key=$(AWS_ACCESS_KEY_ID) --secret_key=$(AWS_SECRET_ACCESS_KEY) put $(DESKTOP_BOX_PATH) $(DESKTOP_OVA_PATH) s3://$(BUCKET_NAME)/
upload/desktop/box:
s3cmd --access_key=$(AWS_ACCESS_KEY_ID) --secret_key=$(AWS_SECRET_ACCESS_KEY) put $(DESKTOP_BOX_PATH) s3://$(BUCKET_NAME)/
upload/desktop/ova:
s3cmd --access_key=$(AWS_ACCESS_KEY_ID) --secret_key=$(AWS_SECRET_ACCESS_KEY) put $(DESKTOP_OVA_PATH) s3://$(BUCKET_NAME)/