X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Dockerfile;h=de76cd83ebdca09119bb71ac410ff52d60528597;hb=refs%2Fchanges%2F95%2F2495%2F1;hp=027e37222b59f1d63e893e534e34000ad18fcf0b;hpb=34e4383c438f87023bc411d9b0baa4a828a7e306;p=ric-plt%2Fappmgr.git diff --git a/Dockerfile b/Dockerfile index 027e372..de76cd8 100755 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ #---------------------------------------------------------- -FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:2-u18.04-nng AS appmgr-build +FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng AS appmgr-build RUN apt-get update -y && apt-get install -y jq @@ -52,13 +52,18 @@ RUN GO111MODULE=on go mod download # build and test COPY . /go/src/ws +# Generate Swagger code RUN /go/bin/swagger generate server -f api/appmgr_rest_api.yaml --name AppManager -t pkg/ --exclude-main COPY . /go/src/ws -RUN make -C /go/src/ws go-build +# Build the code +RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/src/ws/cache/go/cmd/appmgr cmd/appmgr.go -RUN make -C /go/src/ws go-test-fmt +# Run unit tests +RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/cm/ ./pkg/helm/ ./pkg/resthooks/ + +RUN gofmt -l $(find cmd/ pkg/ -name '*.go' -not -name '*_test.go') CMD ["/bin/bash"]