Use go modules and include CI support 07/1307/1
authorRoni Riska <roni.riska@nokia.com>
Thu, 31 Oct 2019 14:16:32 +0000 (16:16 +0200)
committerRoni Riska <roni.riska@nokia.com>
Thu, 31 Oct 2019 14:18:36 +0000 (16:18 +0200)
Start using go modules as go packages should.
Also include a CI support, the docker file
build runs module unit tests.
No publish of anykind.

Change-Id: I4a30ef48a3fe9649942f1a58ea597d7c5b1580b5
Signed-off-by: Roni Riska <roni.riska@nokia.com>
README.md
ci/Dockerfile [new file with mode: 0644]
go.mod [new file with mode: 0644]
go.sum [new file with mode: 0644]

index 1d5ed40..8e84607 100644 (file)
--- a/README.md
+++ b/README.md
@@ -64,3 +64,9 @@ License
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
+
+CI
+--
+
+The Dockerfile in the `ci` directory _only_ runs, when build, the unit tests for the repository.
+
diff --git a/ci/Dockerfile b/ci/Dockerfile
new file mode 100644 (file)
index 0000000..aef7e0d
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (c) 2019 AT&T Intellectual Property.\r
+# Copyright (c) 2018-2019 Nokia.\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#    http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+FROM golang:1.12\r
+\r
+RUN mkdir -p /tmp/golog\r
+COPY . /tmp/golog\r
+RUN cd /tmp/golog && go test . -v\r
+\r
+\r
diff --git a/go.mod b/go.mod
new file mode 100644 (file)
index 0000000..9c12bcf
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,5 @@
+module gerrit.o-ran-sc.org/r/com/golog
+
+go 1.12
+
+require github.com/stretchr/testify v1.4.0
diff --git a/go.sum b/go.sum
new file mode 100644 (file)
index 0000000..8fdee58
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,11 @@
+github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=