Adding support to use golang jenkins plugin 47/37547/2
authorKiran Kamineni <kiran.k.kamineni@intel.com>
Wed, 21 Mar 2018 18:14:29 +0000 (11:14 -0700)
committerKiran Kamineni <kiran.k.kamineni@intel.com>
Wed, 21 Mar 2018 18:32:31 +0000 (11:32 -0700)
Jenkins server has the golang plugin installed
for version 1.10. Modifying the template to use that
so that future template definitions do not need to
download golang each time. This reduces total build time
and network bandwidth usage.

Issue-ID: AAF-184
Change-Id: Ib91f4fb8aa8845bd20d98ba636dffcadf34da297
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
jjb/global-macros.yaml
jjb/global-templates-golang.yaml

index cf34094..6be0e0f 100644 (file)
           timeout: 360
           fail: true
 
+- wrapper:
+    name: golang
+    wrappers:
+      - raw:
+          xml: |
+            <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
+            <goVersion>Golang 1.10</goVersion>
+            </org.jenkinsci.plugins.golang.GolangBuildWrapper>
+
 - wrapper:
     # This wrapper is required for all jobs as it configures the wrappers
     # needed by the eCOMP infra.
index 168fb62..1558c65 100644 (file)
@@ -33,6 +33,7 @@
           submodule-recursive: '{submodule-recursive}'
 
     wrappers:
+      - golang
       - infra-wrappers:
           build-timeout: '{build-timeout}'
 
           settings-file: '{mvn-settings}'
       - shell: |
           #!/bin/bash
-          curl -O https://dl.google.com/go/go1.10.linux-amd64.tar.gz
-          tar -zxf go1.10.linux-amd64.tar.gz
-          export GOROOT=$WORKSPACE/go
-          export PATH=$PATH:$GOROOT/bin
           cd $WORKSPACE/{path}
           make build
 
@@ -95,6 +92,7 @@
           submodule-recursive: '{submodule-recursive}'
 
     wrappers:
+      - golang
       - infra-wrappers:
           build-timeout: '{build-timeout}'
 
           settings-file: '{mvn-settings}'
       - shell: |
           #!/bin/bash
-          curl -O https://dl.google.com/go/go1.10.linux-amd64.tar.gz
-          tar -zxf go1.10.linux-amd64.tar.gz
-          export GOROOT=$PWD/go
-          export PATH=$PATH:$GOROOT/bin
           cd $WORKSPACE/{path}
           make deploy
 
           submodule-recursive: '{submodule-recursive}'
 
     wrappers:
+      - golang
       - infra-wrappers:
           build-timeout: '{build-timeout}'