Juha Hyttinen | 6e075ce | 2019-11-06 08:42:34 +0200 | [diff] [blame] | 1 | # Copyright (c) 2019 AT&T Intellectual Property. |
| 2 | # Copyright (c) 2019 Nokia. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | #---------------------------------------------------------- |
| 17 | # |
| 18 | #---------------------------------------------------------- |
| 19 | |
wahidw | d9ff71c | 2020-12-29 06:52:39 +0000 | [diff] [blame] | 20 | FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as xapp-base |
Juha Hyttinen | 6e075ce | 2019-11-06 08:42:34 +0200 | [diff] [blame] | 21 | RUN apt-get update -y \ |
| 22 | &&apt-get install -y \ |
| 23 | apt-utils \ |
| 24 | cmake \ |
| 25 | gawk \ |
| 26 | sudo \ |
| 27 | nano \ |
| 28 | jq \ |
| 29 | gettext-base \ |
| 30 | bison \ |
| 31 | flex \ |
| 32 | curl \ |
| 33 | tree |
| 34 | |
| 35 | RUN curl -s https://packagecloud.io/install/repositories/o-ran-sc/master/script.deb.sh | bash |
| 36 | |
| 37 | # RMR |
Juha Hyttinen | 0bf1651 | 2020-10-01 09:50:27 +0300 | [diff] [blame] | 38 | ARG RMRVERSION=4.2.2 |
Juha Hyttinen | 6e075ce | 2019-11-06 08:42:34 +0200 | [diff] [blame] | 39 | #RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION} |
Juha Hyttinen | f619d03 | 2020-05-07 12:42:26 +0300 | [diff] [blame] | 40 | RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb |
| 41 | RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb |
Juha Hyttinen | 6e075ce | 2019-11-06 08:42:34 +0200 | [diff] [blame] | 42 | RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb |
| 43 | |
| 44 | # |
| 45 | RUN ldconfig |
| 46 | |
| 47 | # |
| 48 | ENV PATH="/usr/local/go/bin:${PATH}" |
| 49 | |
| 50 | WORKDIR "/" |
| 51 | CMD ["/bin/bash"] |
| 52 | |
| 53 | #---------------------------------------------------------- |
| 54 | # |
| 55 | #---------------------------------------------------------- |
| 56 | FROM xapp-base as xapp-base-testbuild |
| 57 | |
| 58 | |
| 59 | RUN mkdir -p /ws |
| 60 | WORKDIR "/ws" |
| 61 | |
| 62 | # Module prepare (if go.mod/go.sum updated) |
| 63 | COPY go.mod /ws |
| 64 | COPY go.sum /ws |
| 65 | RUN go mod download |
| 66 | |
| 67 | # Copy |
| 68 | COPY . /ws |
| 69 | |
| 70 | # Build |
| 71 | RUN make -C /ws go-build |
| 72 | |
| 73 | # Test fmt |
| 74 | RUN make -C /ws go-test-fmt |
| 75 | |
| 76 | # Test Requires dbaas |
Juha Hyttinen | 3cfee96 | 2020-02-13 13:51:00 +0200 | [diff] [blame] | 77 | RUN make -C /ws go-test |