Skip to content

Commit ede41ee

Browse files
author
Nick Thomas
committed
Simplify building and testing the Go components
1 parent ff46222 commit ede41ee

File tree

8 files changed

+9
-94
lines changed

8 files changed

+9
-94
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang setup _install build compile check clean
22

3-
GO_SOURCES := $(shell find go -name '*.go')
3+
GO_SOURCES := $(shell find . -name '*.go')
44

55
validate: verify test
66

@@ -10,7 +10,7 @@ verify_ruby:
1010
bundle exec rubocop
1111

1212
verify_golang:
13-
support/go-format check
13+
gofmt -s -l $(GO_SOURCES)
1414

1515
test: test_ruby test_golang
1616

@@ -19,7 +19,7 @@ test_ruby:
1919
bundle exec rspec --color --format d spec
2020

2121
test_golang:
22-
support/go-test
22+
go test ./...
2323

2424
setup: _install bin/gitlab-shell
2525

@@ -29,10 +29,10 @@ _install:
2929
build: bin/gitlab-shell
3030
compile: bin/gitlab-shell
3131
bin/gitlab-shell: $(GO_SOURCES)
32-
bin/compile
32+
GOBIN="$(CURDIR)/bin" go install ./cmd/...
3333

3434
check:
3535
bin/check
3636

3737
clean:
38-
rm -f bin/gitlab-shell bin/gitlab-shell-authorized-keys-check bin/gitlab-shell-authorized-principals-check
38+
rm -f bin/check bin/gitlab-shell bin/gitlab-shell-authorized-keys-check bin/gitlab-shell-authorized-principals-check

bin/compile

-20
This file was deleted.

bin/install

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env ruby
22

33
# Load ROOT_PATH and access the minimum necessary config file
4-
require_relative '../support/go_build'
54
require_relative '../support/gitlab_config'
65

76
config = GitlabConfig.new

go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
module gitlab.com/gitlab-org/gitlab-shell/go
1+
module gitlab.com/gitlab-org/gitlab-shell
22

33
go 1.12
44

55
require (
66
github.com/mattn/go-shellwords v0.0.0-20190425161501-2444a32a19f4
77
github.com/otiai10/copy v1.0.1
8-
github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect
98
github.com/sirupsen/logrus v1.2.0
109
github.com/stretchr/testify v1.3.0
1110
gitlab.com/gitlab-org/gitaly v1.68.0
1211
gitlab.com/gitlab-org/labkit v0.0.0-20190221122536-0c3fc7cdd57c
1312
google.golang.org/grpc v1.24.0
14-
gopkg.in/DataDog/dd-trace-go.v1 v1.9.0 // indirect
1513
gopkg.in/yaml.v2 v2.2.2
1614
)

support/gitlab_config.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
require 'yaml'
22

3+
# Determine the root of the gitlab-shell directory
4+
ROOT_PATH = ENV.fetch('GITLAB_SHELL_DIR', File.expand_path('..', __dir__))
5+
36
class GitlabConfig
47
attr_reader :config
58

support/go-format

-16
This file was deleted.

support/go-test

-12
This file was deleted.

support/go_build.rb

-37
This file was deleted.

0 commit comments

Comments
 (0)