Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Turnoff misleading error/warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklanirdesh82 committed Jul 7, 2017
1 parent f5837a9 commit dc2f849
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 73 deletions.
78 changes: 78 additions & 0 deletions Constants.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2016 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

# This Makefile's purpose is to hold common variables to reuse across
# Makefiles for vDVS.

export

# Guest Package Version

# PKG_VERSION is either set externally as part of a build off a tag or
# suffixed with a sha1 of the most recent commit to the prefix of the
# most recent tag. Tagged builds use the externally defined version,
# developer builds use last tagged release and sha1 of the most recent commit.
# Format: <last tagged release>.<last commit hash>
PKG_VERSION ?= $(shell \
git describe --tags `git rev-list --tags --max-count=1` \
).$(shell \
git log --pretty=format:'%h' -n 1)

# Managed plugin alias name
MANAGED_PLUGIN_NAME="vsphere:latest"

# build places binaries here:
BIN := ../build
MANAGED_PLUGIN_LOC := ../plugin

# Use the following environment vars to change the behavior while building managed plugin:
#
# DOCKER_HUB_REPO - Dockerhub repo to use, in both name forming and in pushing to dockerhub.
# Defaults to the result of `whoami` command.
# Note: you first need to run 'docker login' in order for 'make push' to succeed
# VERSION_TAG - How you want the version to look. Default is "current git tag +1 "
# EXTRA_TAG - additional info you want in tag. Default is "-dev"
#
# To check resulting settings use "make info"
# examples:
# make
# --> resulting name (for my build as of 3/17/17) msterin/docker-volume-vsphere:0.13-dev
#
# DOCKER_HUB_REPO=vmware EXTRA_TAG= VERSION_TAG=latest make
# --> resulting name vmware/docker-volume-vsphere:latest
#
# DOCKER_HUB_REPO=cnastorage EXTRA_TAG=-CI make
# --> resulting name cnastorage/docker-volume-vspehere:0.13-CI
#

# grab the latest commit SHA and related tag from git so we can construct plugin tag
ifndef VERSION_TAG
GIT_SHA := $(shell git rev-parse --revs-only --short HEAD)
GIT_TAG := $(shell git describe --tags --abbrev=0 $(GIT_SHA))
endif

# Allow these vars to be suplied in environment
DOCKER_HUB_REPO ?= $(shell whoami)
# "git tag + 1" , so "0.11" becomes "0.12"
VERSION_TAG ?= $(shell echo $(GIT_TAG) | awk -F. '{printf ("%d.%d", $$1, $$2+1)}' )
EXTRA_TAG ?= -dev

# final tag
PLUGIN_TAG := $(VERSION_TAG)$(EXTRA_TAG)

# plugin name - used as a base for full plugin name and container for extracting rootfs
PLUGIN_NAME=$(DOCKER_HUB_REPO)/docker-volume-vsphere

# Binaries we want to pick up from the actual build
BINARY := docker-volume-vsphere
13 changes: 0 additions & 13 deletions esx_service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@
# We expect the actual vibauthor to be run via dedicated container upstair
#

# build places binaries here:
BIN := ../build

# PKG_VERSION is either set externally as part of a build off a tag or
# suffixed with a sha1 of the most recent commit to the prefix of the
# most recent tag. Tagged builds use the externally defined version,
# developer builds use last tagged release and sha1 of the most recent commit.
# Format: <last tagged release>.<last commit hash>
PKG_VERSION ?= $(shell \
git describe --tags `git rev-list --tags --max-count=1` \
).$(shell \
git log --pretty=format:'%h' -n 1)

# Release version needed for vib
RELEASE_VERSION ?= 0.0.1

Expand Down
42 changes: 3 additions & 39 deletions plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,9 @@
# Make targets:
# info (helpful info), clean (remove build artefacts), plugin, (build plugin), push (push to dockerhub)
#
# Use the following environment vars to change the behavior :
#
# DOCKER_HUB_REPO - Dockerhub repo to use, in both name forming and in pushing to dockerhub.
# Defaults to the result of `whoami` command.
# Note: you first need to run 'docker login' in order for 'make push' to succeed
# VERSION_TAG - How you want the version to look. Default is "current git tag +1 "
# EXTRA_TAG - additional info you want in tag. Default is "-dev"
#
# To check resulting settings use "make info"
# examples:
# make
# --> resulting name (for my build as of 3/17/17) msterin/docker-volume-vsphere:0.13-dev
#
# DOCKER_HUB_REPO=vmware EXTRA_TAG= VERSION_TAG=latest make
# --> resulting name vmware/docker-volume-vsphere:latest
#
# DOCKER_HUB_REPO=cnastorage EXTRA_TAG=-CI make
# --> resulting name cnastorage/docker-volume-vspehere:0.13-CI
#

# grab the latest commit SHA and related tag from git so we can construct plugin tag
GIT_SHA := $(shell git rev-parse --revs-only --short HEAD)
GIT_TAG := $(shell git describe --tags --abbrev=0 $(GIT_SHA))

# Allow these vars to be suplied in environment
DOCKER_HUB_REPO ?= $(shell whoami)
# "git tag + 1" , so "0.11" becomes "0.12"
VERSION_TAG ?= $(shell echo $(GIT_TAG) | awk -F. '{printf ("%d.%d", $$1, $$2+1)}' )
EXTRA_TAG ?= -dev

# final tag
PLUGIN_TAG := $(VERSION_TAG)$(EXTRA_TAG)

# plugin name - used as a base for full plugin name and container for extracting rootfs
PLUGIN_NAME=$(DOCKER_HUB_REPO)/docker-volume-vsphere

# Binaries we want to pick up from the actual build
BIN_LOC := ../build
BINARY := docker-volume-vsphere
# Exporting common constants
-include ../Constants.mk

# Tmp docker image used to construct rootfs + our binaries
TMP_IMAGE = $(PLUGIN_NAME):rootfs
Expand Down Expand Up @@ -93,7 +57,7 @@ clean:

plugin: clean
@echo "== building Docker image, unpacking to ./rootfs and creating plugin..."
cp $(BIN_LOC)/$(BINARY) .
cp $(BIN)/$(BINARY) .
docker build -q -t $(TMP_IMAGE) .
docker create --name $(TMP_CONTAINER) $(TMP_IMAGE)
mkdir -p $(TMP_LOC)/rootfs
Expand Down
24 changes: 3 additions & 21 deletions vmdk_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,13 @@

# Makefile for Docker data volume plugin

# Guest Package Version

# PKG_VERSION is either set externally as part of a build off a tag or
# suffixed with a sha1 of the most recent commit to the prefix of the
# most recent tag. Tagged builds use the externally defined version,
# developer builds use last tagged release and sha1 of the most recent commit.
# Format: <last tagged release>.<last commit hash>
PKG_VERSION ?= $(shell \
git describe --tags `git rev-list --tags --max-count=1` \
).$(shell \
git log --pretty=format:'%h' -n 1)

export PKG_VERSION
export INCLUDE_UI

-include ../plugin/Makefile
# Exporting common constants
-include ../Constants.mk

EPOCH := 0

# Place binaries here
BIN := ../build
MANAGED_PLUGIN := ../plugin

# Location for scripts
SCRIPTS := ../misc/scripts

Expand Down Expand Up @@ -294,7 +278,7 @@ deploy-vm: clean-vm
deploy-vm-test:
$(DEPLOY_VM_TEST_SH) "$(VMS)" $(BIN) $(SCRIPTS)
deploy-vm-plugin:
$(DEPLOY_VM_PLUGIN_SH) "$(VM2)" $(PLUGIN_BIN) $(MANAGED_PLUGIN) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG)
$(DEPLOY_VM_PLUGIN_SH) "$(VM2)" $(PLUGIN_BIN) $(MANAGED_PLUGIN_LOC) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG)

deploy-all: deploy-esx deploy-vm deploy-vm-test
deploy: deploy-all
Expand Down Expand Up @@ -373,8 +357,6 @@ test-e2e-runonce:
$(log_target)
$(GO) test -v -timeout 30m -tags runonce $(E2E_Tests)

MANAGED_PLUGIN_NAME="vsphere:latest"

.PHONY:clean-vm clean-esx clean-all clean-docker
clean-vm:
$(CLEANVM_SH) "$(VMS)" "$(MANAGED_PLUGIN_NAME)"
Expand Down

0 comments on commit dc2f849

Please sign in to comment.