This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
99 lines (80 loc) · 2.93 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2018 Pax Automa Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
BUILD_NUM=x
ISO_VERSION=$(shell cat operos-version).$(BUILD_NUM)
IMG_PREFIX_WORKER=operos-worker
IMG_PREFIX_CONTROLLER=operos-controller
.PHONY: all setup
all: setup isobuild
setup: vagrant packages images
include components/common.mk
include components/installer/installer.mk
include components/statustty/statustty.mk
include components/diag/diag.mk
include components/prospector/prospector.mk
include components/teamster/teamster.mk
include components/waterfront/waterfront.mk
# Write the .buildnum file if the build number changed since the last build.
# This file can serve as a prerequisite for builds that depend on the build
# number.
$(shell \
if [ ! -e .buildnum ] || [ "`cat .buildnum`" != "$(BUILD_NUM)" ]; then \
echo $(BUILD_NUM) > .buildnum; \
fi > /dev/null \
)
WORKER_FILES=$(shell find iso/worker/ -type f)
CONTROLLER_FILES=$(shell find iso/controller/ -type f)
.PHONY: vagrant
vagrant:
if ! vagrant plugin list | grep -q reload; then \
vagrant plugin install vagrant-reload; \
fi
vagrant up
.PHONY: packages images test isobuild
packages images test isobuild isobuild-dev installer statustty diag prospector teamster:
time vagrant ssh -c "cd ~/operos && make $@-novm BUILD_NUM=$(BUILD_NUM)"
.PHONY: packages-novm
packages-novm:
sudo ./update-pkgs.sh
.PHONY: images-novm
images-novm:
sudo ./update-imgs.sh
isobuild: waterfront
isobuild-dev: waterfront
isobuild-novm: installer-novm statustty-novm diag-novm teamster-novm prospector-novm
cp versions iso/installer/airootfs/root/versions
sudo ./vagrant-build.sh -V $(ISO_VERSION) -L OPEROS_$(subst .,_,$(ISO_VERSION)) base node worker controller installer
isobuild-dev-novm: installer-novm statustty-novm diag-novm teamster-novm prospector-novm keys/testkey
cp versions iso/installer/airootfs/root/versions
sudo ./vagrant-build.sh -V $(ISO_VERSION) -L OPEROS_$(subst .,_,$(ISO_VERSION)) -d base node worker controller installer
keys/testkey:
mkdir -p keys
ssh-keygen -f $@ -N ""
.PHONY: test-novm
test-novm:
go test -v ./src/...
vendor: glide.lock
rm -rf vendor
glide install
# this file does not compile under alpine (depends on glibc) and is only
# used during testing of the go-crypt package, so can be safely deleted.
rm vendor/github.com/amoghe/go-crypt/version.go
clean:
rm -f keys/testkey
rm -f keys/testkey.pub
rm -rf vendor
rm -f out/*
rm -rf operos-credentials/
distclean: clean
rm -rf cache/