--- /dev/null
+- job-template:
+ name: 'oransc-{project-name}-verify-go'
+ node: oransc-ubuntu2004
+ disabled: false
+ concurrent: true
+
+ properties:
+ - logrotate
+
+ parameters:
+ - nordix-gerrit-parameters
+ - string:
+ name: PROJECT
+ default: 'oransc/{project}'
+ description: JJB configured PROJECT parameter to identify a Nordix Gerrit project
+ - string:
+ name: GERRIT_REFSPEC
+ default: ''
+
+ scm:
+ - git-scm-gerrit:
+ ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
+ branch: $GERRIT_BRANCH
+ refspec: $GERRIT_REFSPEC
+ wipe_workspace: true
+ clean_before: false
+
+ triggers:
+ - nordix-gerrit-trigger-patchset-created:
+ project: 'oransc/{project}'
+ branch: '**'
+ files: '**'
+
+ wrappers:
+ - build-timeout:
+ timeout: 45
+
+ builders:
+ - shell:
+ !include-raw-escape: ./verify-jobs-go.sh
name: nonrtric-plt-dmaapmediatorproducer-verify
project: nonrtric/plt/dmaapmediatorproducer
project-name: nonrtric-plt-dmaapmediatorproducer
- jdk-version: java-11
jobs:
- - 'oransc-{project-name}-verify-java'
\ No newline at end of file
+ - 'oransc-{project-name}-verify-go'
\ No newline at end of file
name: nonrtric-rapp-orufhrecovery-verify
project: nonrtric/rapp/orufhrecovery
project-name: nonrtric-rapp-orufhrecovery
- jdk-version: java-11
jobs:
- - 'oransc-{project-name}-verify-java'
\ No newline at end of file
+ - 'oransc-{project-name}-verify-go'
\ No newline at end of file
name: nonrtric-rapp-ransliceassurance-verify
project: nonrtric/rapp/ransliceassurance
project-name: nonrtric-rapp-ransliceassurance
- jdk-version: java-11
jobs:
- - 'oransc-{project-name}-verify-java'
\ No newline at end of file
+ - 'oransc-{project-name}-verify-go'
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+set -euo pipefail
+
+cd $WORKSPACE
+
+# read go version from go.mod file
+version=$(grep '^go' go.mod | grep -Eo '[0-9]\.[0-9]+')
+
+echo "Download go $version"
+curl -L "https://go.dev/dl/go$version.linux-amd64.tar.gz" | tar -C /usr/local -zxf -
+
+export PATH=$PATH:/usr/local/go/bin
+export CGO_ENABLED=0
+
+echo "Download project deps"
+go mod tidy
+
+echo "Run tests"
+go test ./...