forked from restic/rest-server
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
39 lines (29 loc) · 989 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
35
36
37
38
39
# Copyright © 2017 Zlatko Čalušić
#
# Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
#
DOCKER_IMAGE ?= restic/rest-server
REST_SERVER_VERSION := $(strip $(shell cat VERSION))
.PHONY: default rest-server install uninstall docker_build docker_push clean
default: rest-server
rest-server:
@go run build.go
install: rest-server
sudo /usr/bin/install -m 755 rest-server /usr/local/bin/rest-server
uninstall:
sudo rm -f /usr/local/bin/rest-server
docker_build:
docker pull golang:alpine
docker run --rm -it \
-v $(CURDIR):/go/src/github.com/restic/rest-server \
-w /go/src/github.com/restic/rest-server \
golang:alpine \
go run build.go
docker pull alpine
docker build -t $(DOCKER_IMAGE):$(REST_SERVER_VERSION) .
docker tag $(DOCKER_IMAGE):$(REST_SERVER_VERSION) $(DOCKER_IMAGE):latest
docker_push:
docker push $(DOCKER_IMAGE):$(REST_SERVER_VERSION)
docker push $(DOCKER_IMAGE):latest
clean:
rm -f rest-server