Skip to content

Commit 3d51923

Browse files
committed
make CI faster
Build GoBGP binaries of a pull request locally and copy them to the container to be tested instead of copying the code into the container and building the binaries inside. Signed-off-by: FUJITA Tomonori <[email protected]>
1 parent e67e373 commit 3d51923

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/lib/fabfile.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ def make_gobgp_ctn(ctx, tag='gobgp',
1111
if local_gobgp_path == '':
1212
local_gobgp_path = os.getcwd()
1313

14+
local('CGO_ENABLED=0 go build "-ldflags=-s -w -buildid=" ./cmd/gobgp')
15+
local('CGO_ENABLED=0 go build "-ldflags=-s -w -buildid=" ./cmd/gobgpd')
16+
1417
c = CmdBuffer()
1518
c << 'FROM {0}'.format(from_image)
16-
c << 'ENV GO111MODULE on'
17-
c << 'ADD gobgp /tmp/gobgp'
18-
c << 'RUN cd /tmp/gobgp && go install ./cmd/gobgpd ./cmd/gobgp'
19+
c << 'COPY gobgp/gobgpd /go/bin/gobgpd'
20+
c << 'COPY gobgp/gobgp /go/bin/gobgp'
1921

2022
rindex = local_gobgp_path.rindex('gobgp')
2123
if rindex < 0:

0 commit comments

Comments
 (0)