blob: ced4e17acaa32375c4810d27853b249b04174a26 [file] [log] [blame]
Matteo Scandolo60676562019-03-15 14:56:25 -07001# Copyright 2018 Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Matteo Scandoloddaa32c2019-05-22 10:55:45 -070015# Variables
16VERSION ?= $(shell cat ./VERSION)
17SERVICE_NAME ?= sadis-server
Matteo Scandolo60676562019-03-15 14:56:25 -070018
Matteo Scandoloddaa32c2019-05-22 10:55:45 -070019## Docker related
20DOCKER_REGISTRY ?=
21DOCKER_REPOSITORY ?=
22DOCKER_BUILD_ARGS ?=
23DOCKER_TAG ?= ${VERSION}
24DOCKER_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}${SERVICE_NAME}:${DOCKER_TAG}
Matteo Scandolo60676562019-03-15 14:56:25 -070025
Matteo Scandoloddaa32c2019-05-22 10:55:45 -070026all: test
Matteo Scandolo60676562019-03-15 14:56:25 -070027
Matteo Scandoloddaa32c2019-05-22 10:55:45 -070028docker-build:
29 docker build $(DOCKER_BUILD_ARGS) \
30 -t ${DOCKER_IMAGENAME} \
31 --build-arg org_label_schema_version="${VERSION}" \
32 --build-arg org_label_schema_vcs_url="${DOCKER_LABEL_VCS_URL}" \
33 --build-arg org_label_schema_vcs_ref="${DOCKER_LABEL_VCS_REF}" \
34 --build-arg org_label_schema_build_date="${DOCKER_LABEL_BUILD_DATE}" \
35 --build-arg org_opencord_vcs_commit_date="${DOCKER_LABEL_COMMIT_DATE}" \
36 -f Dockerfile .
37
38docker-push:
39 docker push ${DOCKER_IMAGENAME}
40
41test:
42 go test -v ./...