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

Commit

Permalink
Scripts change to enable CI for vFile. (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miao Luo committed Sep 14, 2017
1 parent 299431d commit aaa7af5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions Commonvars.mk
Expand Up @@ -59,6 +59,7 @@ VFILE_PLUGIN_NAME = $(DOCKER_HUB_REPO)/vfile

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

# build places binaries here:
BIN := ../build
Expand Down
10 changes: 9 additions & 1 deletion client_plugin/Makefile
Expand Up @@ -49,6 +49,9 @@ DOCKER_PACKAGE_PHOTON := docker
AFTER_INSTALL := $(SCRIPTS)/install/after-install.sh
BEFORE_REMOVE := $(SCRIPTS)/install/before-remove.sh
AFTER_REMOVE := $(SCRIPTS)/install/after-remove.sh
VFILE_PREFIX := vfile-
PLUGIN_ALIAS := vsphere
VFILE_PLUGIN_ALIAS := $(VFILE_PLUGNAME)

#
# Scripts to deploy and control services - used from Makefile and from Drone CI
Expand Down Expand Up @@ -330,7 +333,7 @@ VMS= $(VM1) $(VM2) $(WORKER2) $(CI_NODE4)
WIN_VMS= $(WIN_VM1)

deploy-vm: clean-vm
$(DEPLOY_VM_SH) "$(VMS)" $(PLUGIN_NAME):$(PLUGIN_TAG)
$(DEPLOY_VM_SH) "$(VMS)" $(PLUGIN_NAME):$(PLUGIN_TAG) $(PLUGIN_ALIAS) $(PLUGNAME)
deploy-vm-test:
$(DEPLOY_VM_TEST_SH) "$(VMS)" $(BIN) $(SCRIPTS)
build-plugin:
Expand All @@ -339,6 +342,11 @@ build-windows-plugin:
$(BUILD_WINDOWS_PLUGIN_SH) $(WIN_VM1)
deploy-windows-plugin:
$(DEPLOY_WINDOWS_PLUGIN_SH) "$(WIN_VMS)"
build-vfile-plugin:
$(BUILD_PLUGIN_SH) "$(VM2)" $(VFILE_PLUGIN_BIN) $(MANAGED_PLUGIN_LOC) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG) $(VFILE_PREFIX)
deploy-vfile-plugin:
$(DEPLOY_VM_SH) "$(VMS)" $(VFILE_PLUGIN_NAME):$(PLUGIN_TAG) $(VFILE_PLUGIN_ALIAS) $(VFILE_PLUGNAME)


deploy-all: deploy-esx deploy-vm deploy-vm-test
deploy: deploy-all
Expand Down
3 changes: 3 additions & 0 deletions misc/drone-scripts/deploy-and-test-wrapper.sh
Expand Up @@ -117,6 +117,9 @@ coverage)
winplugin)
TARGET=" build-windows-plugin deploy-windows-plugin test-e2e-runonce-windows"
;;
vfileplugin)
TARGET=" build-plugin build-vfile-plugin deploy-vm deploy-vfile-plugin test-e2e-runonce-vfile"
;;
esac

if make -s $TARGET $PARAMETER;
Expand Down
13 changes: 8 additions & 5 deletions misc/scripts/deploy-tools.sh
Expand Up @@ -91,9 +91,9 @@ function buildplugin {
esac

fi
$SSH $TARGET "cd $PLUGIN_LOC ; DOCKER_HUB_REPO=$DOCKER_HUB_REPO VERSION_TAG=$VERSION_TAG EXTRA_TAG=$EXTRA_TAG make info clean plugin"
$SSH $TARGET "cd $PLUGIN_LOC ; DOCKER_HUB_REPO=$DOCKER_HUB_REPO VERSION_TAG=$VERSION_TAG EXTRA_TAG=$EXTRA_TAG make ${PREFIX}info ${PREFIX}clean ${PREFIX}plugin"
managedPluginSanityCheck
$SSH $TARGET "cd $PLUGIN_LOC ; DOCKER_HUB_REPO=$DOCKER_HUB_REPO VERSION_TAG=$VERSION_TAG EXTRA_TAG=$EXTRA_TAG make push clean"
$SSH $TARGET "cd $PLUGIN_LOC ; DOCKER_HUB_REPO=$DOCKER_HUB_REPO VERSION_TAG=$VERSION_TAG EXTRA_TAG=$EXTRA_TAG make ${PREFIX}push ${PREFIX}clean"
done
}

Expand Down Expand Up @@ -167,7 +167,7 @@ function setupVMType {

function installManagedPlugin {
log "installManagedPlugin: Installing vDVS plugin [$MANAGED_PLUGIN_NAME]"
$SSH $TARGET "docker plugin install --grant-all-permissions --alias vsphere $MANAGED_PLUGIN_NAME"
$SSH $TARGET "docker plugin install --grant-all-permissions --alias $PLUGIN_ALIAS $MANAGED_PLUGIN_NAME"
}

function deployVMPost {
Expand Down Expand Up @@ -414,9 +414,11 @@ cleanesx)
;;
deployvm)
MANAGED_PLUGIN_NAME="$2"
if [ -z "$MANAGED_PLUGIN_NAME" ]
PLUGIN_ALIAS="$3"
PLUGIN_NAME="$4"
if [ -z "$MANAGED_PLUGIN_NAME" -o -z "$PLUGIN_ALIAS" ]
then
usage "Missing params: managed_plugin_name"
usage "Missing params: managed_plugin_name|plugin_alias"
fi
deployvm
;;
Expand Down Expand Up @@ -444,6 +446,7 @@ buildplugin)
DOCKER_HUB_REPO="$5"
VERSION_TAG="$6"
EXTRA_TAG="$7"
PREFIX="$8"
if [ -z "$PLUGIN_BIN" -o -z "$MANAGED_PLUGIN_SRC" -o -z "$SCRIPTS" ]
then
usage "Missing params: plugin/binary/script folder"
Expand Down

0 comments on commit aaa7af5

Please sign in to comment.