diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2021-07-01 13:07:22 +0000 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2021-07-01 13:07:22 +0000 |
commit | 9c675e374c0679af5e12bda2bbc0f26d230f2cba (patch) | |
tree | 23f6545dcc45433bfdc05148481bb4577ca6212c | |
parent | ebef7c3d74407d2e89dd8a44c6ad3b5924495699 (diff) | |
parent | c289756d4ee4cb11fc41dc5ac7aafe19bfc12b92 (diff) | |
download | gitlab-shell-9c675e374c0679af5e12bda2bbc0f26d230f2cba.tar.gz |
Merge branch '475-make-install' into 'main'
Add a make install command
Closes #475
See merge request gitlab-org/gitlab-shell!490
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | README.md | 28 |
2 files changed, 38 insertions, 7 deletions
@@ -1,4 +1,4 @@ -.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang coverage coverage_golang setup _install build compile check clean +.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang coverage coverage_golang setup _script_install build compile check clean install GO_SOURCES := $(shell find . -name '*.go') VERSION_STRING := $(shell git describe --match v* 2>/dev/null || awk '$0="v"$0' VERSION 2>/dev/null || echo unknown) @@ -6,6 +6,8 @@ BUILD_TIME := $(shell date -u +%Y%m%d.%H%M%S) BUILD_TAGS := tracer_static tracer_static_jaeger continuous_profiler_stackdriver GOBUILD_FLAGS := -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)" -tags "$(BUILD_TAGS)" +PREFIX ?= /usr/local + validate: verify test verify: verify_golang @@ -30,9 +32,9 @@ coverage: coverage_golang coverage_golang: [ -f cover.out ] && go tool cover -func cover.out -setup: _install bin/gitlab-shell +setup: _script_install bin/gitlab-shell -_install: +_script_install: bin/install build: bin/gitlab-shell @@ -45,3 +47,12 @@ check: clean: rm -f bin/check bin/gitlab-shell bin/gitlab-shell-authorized-keys-check bin/gitlab-shell-authorized-principals-check bin/gitlab-sshd + +install: compile + mkdir -p $(DESTDIR)$(PREFIX)/bin/ + install -m755 bin/check $(DESTDIR)$(PREFIX)/bin/check + install -m755 bin/gitlab-shell $(DESTDIR)$(PREFIX)/bin/gitlab-shell + install -m755 bin/gitlab-shell $(DESTDIR)$(PREFIX)/bin/gitlab-shell-authorized-keys-check + install -m755 bin/gitlab-shell $(DESTDIR)$(PREFIX)/bin/gitlab-shell-authorized-principals-check + install -m755 bin/gitlab-shell $(DESTDIR)$(PREFIX)/bin/gitlab-sshd + @@ -34,16 +34,36 @@ Download and install the current version of Go from https://golang.org/dl/ We follow the [Golang Release Policy](https://golang.org/doc/devel/release.html#policy) of supporting the current stable version and the previous two major versions. -## Setup - - make setup - ## Check Checks if GitLab API access and redis via internal API can be reached: make check +## Compile + +Builds the `gitlab-shell` binaries, placing them into `bin/`. + + make compile + +## Install + +Builds the `gitlab-shell` binaries and installs them onto the filesystem. The +default location is `/usr/local`, but can be controlled by use of the `PREFIX` +and `DESTDIR` environment variables. + + make install + +## Setup + +This command is intended for use when installing GitLab from source on a single +machine. In addition to compiling the gitlab-shell binaries, it ensures that +various paths on the filesystem exist with the correct permissions. Do not run +it unless instructed to by your installation method documentation. + + make setup + + ## Testing Run tests: |