Files
Valentin Rothberg 5875e409e2 vendor c/psgo@v1.7.1
psgo added support for listing supplementary groups via
two new descriptors:

* `groups` for supplementary groups inside the container
* `hgroups` for the counterpart on the host

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-22 10:35:08 +02:00

56 lines
1.0 KiB
Makefile

SHELL= /bin/bash
GO ?= go
BUILD_DIR := ./bin
BIN_DIR := /usr/local/bin
NAME := psgo
BATS_TESTS := *.bats
# Not all platforms support -buildmode=pie, plus it's incompatible with -race.
ifeq ($(shell $(GO) env GOOS),linux)
ifeq (,$(filter $(shell $(GO) env GOARCH),mips mipsle mips64 mips64le ppc64 riscv64))
ifeq (,$(findstring -race,$(EXTRA_BUILD_FLAGS)))
GO_BUILDMODE := "-buildmode=pie"
endif
endif
endif
GO_BUILD := $(GO) build $(GO_BUILDMODE)
all: validate build
.PHONY: build
build:
$(GO_BUILD) $(EXTRA_BUILD_FLAGS) -o $(BUILD_DIR)/$(NAME) ./sample
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
.PHONY: vendor
vendor:
go mod tidy
go mod vendor
go mod verify
.PHONY: validate
validate:
golangci-lint run
.PHONY: test
test: test-unit test-integration
.PHONY: test-integration
test-integration:
bats test/$(BATS_TESTS)
.PHONY: test-unit
test-unit:
$(GO) test -v $(EXTRA_TEST_FLAGS) ./...
.PHONY: install
install:
sudo install -D -m755 $(BUILD_DIR)/$(NAME) $(BIN_DIR)
.PHONY: uninstall
uninstall:
sudo rm $(BIN_DIR)/$(NAME)