Skip to content

Commit bb087e8

Browse files
committed
use lib-go buildmachinery
1 parent 675506a commit bb087e8

File tree

4 files changed

+39
-27
lines changed

4 files changed

+39
-27
lines changed

Dockerfile.rhel7

-19
This file was deleted.

Makefile

+29-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
1-
GOFLAGS :=
2-
IMAGE_REPOSITORY_NAME ?= openshift
1+
.PHONY: all
32

4-
build:
5-
go build -mod=vendor $(GOFLAGS) .
6-
.PHONY: build
3+
# Include the library makefile
4+
include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
5+
golang.mk \
6+
targets/openshift/deps-gomod.mk \
7+
targets/openshift/images.mk \
8+
)
79

8-
images:
9-
imagebuilder -f Dockerfile -t $(IMAGE_REPOSITORY_NAME)/oauth-proxy .
10-
.PHONY: images
10+
IMAGE_REGISTRY?=registry.svc.ci.openshift.org
11+
12+
# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
13+
# $0 - macro name
14+
# $1 - target name
15+
# $2 - image ref
16+
# $3 - Dockerfile path
17+
# $4 - context directory for image build
18+
# It will generate target "image-$(1)" for building the image and binding it as a prerequisite to target "images".
19+
$(call build-image,ocp-oauth-proxy,$(IMAGE_REGISTRY)/ocp/4.6:oauth-proxy,./Dockerfile,.)
1120

1221
clean:
1322
$(RM) ./oauth-proxy
1423
.PHONY: clean
24+
25+
GO_BUILD_PACKAGES := .
26+
# avoid the test/ directory only containing the e2e tests
27+
GO_TEST_PACKAGES :=./ ./api/... ./cookie/... ./providers/... ./util/...
28+
29+
test-e2e: GO_TEST_PACKAGES :=./test/e2e/...
30+
test-e2e: GO_TEST_FLAGS += -v
31+
test-e2e: GO_TEST_FLAGS += -timeout 3h
32+
test-e2e: GO_TEST_FLAGS += -count 1
33+
test-e2e: GO_TEST_FLAGS += -p 1
34+
test-e2e: test-unit
35+
.PHONY: test-e2e

dependencymagnet.go

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// +build tools
2+
3+
// go mod won't pull in code that isn't depended upon, but we have some code we don't depend on from code that must be included
4+
// for our build to work.
5+
package dependencymagnet
6+
7+
import (
8+
_ "github.com/openshift/build-machinery-go"
9+
)

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
1010
github.com/fsnotify/fsnotify v1.4.9
1111
github.com/mreiferson/go-options v1.0.0
12+
github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7
1213
github.com/openshift/library-go v0.0.0-20200918101923-1e4c94603efe
1314
github.com/yhat/wsutil v0.0.0-20170731153501-1d66fa95c997
1415
golang.org/x/net v0.0.0-20200904194848-62affa334b73

0 commit comments

Comments
 (0)