forked from compliance-framework/nano-web
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
34 lines (27 loc) · 969 Bytes
/
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
PKGOS=linux
PKGARCH=amd64
PKGNAME=nano-web
PKGVERSION:=$(shell ./scripts/get-version.sh)
PKGRELEASE=$(PKGNAME)_$(PKGVERSION)
RELEASEDIR=./release
PKGDIR=$(RELEASEDIR)/$(PKGRELEASE)-$(PKGARCH)
pkg-clean:
rm -rf $(RELEASEDIR)
pkg-build:
CGO_ENABLED=0 GOOS=$(PKGOS) GOARCH=$(PKGARCH) go build -o $(PKGDIR)/$(PKGNAME) main.go
pkg-create: pkg-clean
mkdir -p $(PKGDIR)/sysroot
mkdir -p $(PKGDIR)/sysroot/public
PKGVERSION=$(PKGVERSION) PKGNAME=$(PKGNAME) ./scripts/make-manifest.sh > $(PKGDIR)/package.manifest
cp README.md $(PKGDIR)
pkg-add: pkg-create pkg-build
# TODO: add --arch $(PKGARCH) once ops supports it
ops pkg add $(PKGDIR) --name $(PKGRELEASE)
pkg-bundle: pkg-add
cd $(RELEASEDIR); tar czvf $(PKGRELEASE)-$(PKGARCH).tar.gz $(PKGRELEASE)
@echo "Release created: $(PKGDIR)-$(PKGARCH).tar.gz"
pkg-push: pkg-add
# TODO: add --arch $(PKGARCH) once ops supports it
ops pkg push $(PKGRELEASE)
pkg-load: pkg-add
ops pkg load -l $(PKGRELEASE) -p 80