Alok Bhatt | 57da2da | 2020-09-29 10:46:07 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Installs NNG then runs a build script in the repository |
| 3 | # Assumes ubuntu - uses apt-get |
| 4 | |
| 5 | echo "--> prescan-sdlgo-go-ubuntu.sh" |
| 6 | |
| 7 | set -ex |
| 8 | |
| 9 | sudo apt-get install -y cmake ninja-build |
| 10 | |
| 11 | # NNG repo is not frequently tagged so it's pinned to a commit hash. |
| 12 | # This commit repairs bug https://github.com/nanomsg/nng/issues/970 |
| 13 | git clone https://github.com/nanomsg/nng.git |
| 14 | (cd nng \ |
| 15 | && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \ |
| 16 | && mkdir build \ |
| 17 | && cd build \ |
| 18 | && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \ |
| 19 | && ninja \ |
| 20 | && sudo ninja install) |
| 21 | #!/bin/bash |
| 22 | |
| 23 | #================================================================================== |
| 24 | # Copyright (c) 2020 AT&T Intellectual Property. |
| 25 | # Copyright (c) 2020 Nokia |
| 26 | # |
| 27 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 28 | # you may not use this file except in compliance with the License. |
| 29 | # You may obtain a copy of the License at |
| 30 | # |
| 31 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 32 | # |
| 33 | # Unless required by applicable law or agreed to in writing, software |
| 34 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 35 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 36 | # See the License for the specific language governing permissions and |
| 37 | # limitations under the License. |
| 38 | #================================================================================== |
| 39 | # Go install, build, etc |
| 40 | export GOPATH=$HOME/go |
| 41 | export PATH=$GOPATH/bin:$PATH |
| 42 | |
| 43 | # xApp-framework stuff |
| 44 | export CFG_FILE=../config/config-file.json |
| 45 | export RMR_SEED_RT=../config/uta_rtg.rt |
| 46 | |
| 47 | GO111MODULE=on GO_ENABLED=0 GOOS=linux |
| 48 | |
| 49 | # setup version tag |
| 50 | if [ -f container-tag.yaml ] |
| 51 | then |
| 52 | tag=$(grep "tag:" container-tag.yaml | awk '{print $2}') |
| 53 | else |
| 54 | tag="no-tag-found" |
| 55 | fi |
| 56 | |
| 57 | hash=$(git rev-parse --short HEAD || true) |
| 58 | |
| 59 | # Build |
| 60 | |
Timo Tietavainen | 9412d39 | 2022-02-08 18:44:27 +0200 | [diff] [blame] | 61 | go build ./... |
Alok Bhatt | 57da2da | 2020-09-29 10:46:07 +0000 | [diff] [blame] | 62 | |
| 63 | # Execute UT and measure coverage |
| 64 | |
Timo Tietavainen | 9412d39 | 2022-02-08 18:44:27 +0200 | [diff] [blame] | 65 | go test ./... -v -coverprofile cover.out || true |
Alok Bhatt | 57da2da | 2020-09-29 10:46:07 +0000 | [diff] [blame] | 66 | |
| 67 | echo "--> build_sdlgo_ubuntu.sh ends" |
| 68 | |
| 69 | echo "--> prescan-sdlgo-go-ubuntu.sh ends" |