summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2020-11-09 22:28:34 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2020-11-09 22:47:14 +0900
commit3d51923e3c33da286a4242627d00933aaad19eec (patch)
treef22bbf5bf5797859fe01eb38a30758541a56a508
parente67e3739577f1183ae944b624bb8f5f317b2e44f (diff)
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 <fujita.tomonori@gmail.com>
-rw-r--r--test/lib/fabfile.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/lib/fabfile.py b/test/lib/fabfile.py
index c50b7e22..660b612f 100644
--- a/test/lib/fabfile.py
+++ b/test/lib/fabfile.py
@@ -11,11 +11,13 @@ def make_gobgp_ctn(ctx, tag='gobgp',
if local_gobgp_path == '':
local_gobgp_path = os.getcwd()
+ local('CGO_ENABLED=0 go build "-ldflags=-s -w -buildid=" ./cmd/gobgp')
+ local('CGO_ENABLED=0 go build "-ldflags=-s -w -buildid=" ./cmd/gobgpd')
+
c = CmdBuffer()
c << 'FROM {0}'.format(from_image)
- c << 'ENV GO111MODULE on'
- c << 'ADD gobgp /tmp/gobgp'
- c << 'RUN cd /tmp/gobgp && go install ./cmd/gobgpd ./cmd/gobgp'
+ c << 'COPY gobgp/gobgpd /go/bin/gobgpd'
+ c << 'COPY gobgp/gobgp /go/bin/gobgp'
rindex = local_gobgp_path.rindex('gobgp')
if rindex < 0: