forked from sylabs/wlm-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (45 loc) · 1.13 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
# silent build
V := @
BIN_DIR := ./bin
RED_BOX := $(BIN_DIR)/red-box
LDFLAGS = -ldflags "-X main.version=`(git describe --dirty --always 2>/dev/null || echo "unknown") \
| sed -e "s/^v//;s/-/_/g;s/_/-/;s/_/./g"`"
all: $(RED_BOX)
$(RED_BOX):
@echo " GO" $@
$(V)go build -mod vendor ${LDFLAGS} -o $(RED_BOX) ./cmd/red-box
.PHONY: clean
clean:
@echo " CLEAN"
$(V)go clean -mod vendor
$(V)rm -rf $(BIN_DIR)
.PHONY: test
test:
$(V)go test -mod vendor -v -coverprofile=cover.out -race ./...
.PHONY: lint
lint:
$(V)golangci-lint run --config .golangci.local.yml
.PHONY: push
push: TAG=latest
push:
$(V)for f in `ls sif` ; do \
echo " PUSH" $${f}:${TAG} ; \
sudo singularity build sif/$${f}.sif sif/$${f} ;\
singularity sign sif/$${f}.sif;\
singularity push sif/$${f}.sif library://library/slurm/$${f}:${TAG};\
done
.PHONY: dep
dep:
$(V)go mod tidy
$(V)go mod vendor
.PHONY: gen
gen:
$(V)go generate generate.go
.PHONY: release_binaries
release_binaries:
$(V)go get -u github.com/itchio/gothub
$(V)gothub upload --user sylabs \
--repo wlm-operator \
--tag ${RELEASE_TAG} \
--name "red-box" \
--file ${BINARY_PATH}