Matteo Scandolo | 6067656 | 2019-03-15 14:56:25 -0700 | [diff] [blame] | 1 | # 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 Scandolo | ddaa32c | 2019-05-22 10:55:45 -0700 | [diff] [blame] | 15 | # Variables |
| 16 | VERSION ?= $(shell cat ./VERSION) |
| 17 | SERVICE_NAME ?= sadis-server |
Matteo Scandolo | 6067656 | 2019-03-15 14:56:25 -0700 | [diff] [blame] | 18 | |
Matteo Scandolo | ddaa32c | 2019-05-22 10:55:45 -0700 | [diff] [blame] | 19 | ## Docker related |
| 20 | DOCKER_REGISTRY ?= |
| 21 | DOCKER_REPOSITORY ?= |
| 22 | DOCKER_BUILD_ARGS ?= |
| 23 | DOCKER_TAG ?= ${VERSION} |
| 24 | DOCKER_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}${SERVICE_NAME}:${DOCKER_TAG} |
Matteo Scandolo | 6067656 | 2019-03-15 14:56:25 -0700 | [diff] [blame] | 25 | |
Matteo Scandolo | ddaa32c | 2019-05-22 10:55:45 -0700 | [diff] [blame] | 26 | all: test |
Matteo Scandolo | 6067656 | 2019-03-15 14:56:25 -0700 | [diff] [blame] | 27 | |
Matteo Scandolo | ddaa32c | 2019-05-22 10:55:45 -0700 | [diff] [blame] | 28 | docker-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 | |
| 38 | docker-push: |
| 39 | docker push ${DOCKER_IMAGENAME} |
| 40 | |
| 41 | test: |
| 42 | go test -v ./... |