Skip to content

Commit

Permalink
F #2065: Docker Machine plugin build changes (#2068)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlastimil Holer authored and Tino Vázquez committed May 9, 2018
1 parent ba62a34 commit a872eb2
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 67 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ src/oca/java/jar
src/oca/java/share/doc
src/oca/java/java-oca*.tar.gz

src/docker_machine/pkg
src/docker_machine/src/docker_machine/bin/docker-machine-driver-opennebula
src/docker_machine/src/docker_machine/vendor/

src/sunstone/public/.sass-cache
src/sunstone/public/node_modules
src/sunstone/public/bower_components
Expand Down
26 changes: 20 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ if [ -z "$ROOT" ] ; then

CHOWN_DIRS=""
elif [ "$DOCKER_MACHINE" = "yes" ]; then
mkdir $SHARE_LOCATION/docker_machine
mv $DOCKER_MACHINE_LOCATION $SHARE_LOCATION/docker_machine
MAKE_DIRS="$BIN_LOCATION"

DELETE_DIRS="$MAKE_DIRS"

CHOWN_DIRS=""
else
MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
$INCLUDE_LOCATION $SHARE_LOCATION $DOCS_LOCATION \
Expand Down Expand Up @@ -208,8 +211,9 @@ else

DELETE_DIRS="$MAKE_DIRS"
elif [ "$DOCKER_MACHINE" = "yes" ]; then
mkdir $SHARE_LOCATION/docker_machine
mv $DOCKER_MACHINE_LOCATION $SHARE_LOCATION/docker_machine
MAKE_DIRS="$BIN_LOCATION"

DELETE_DIRS="$MAKE_DIRS"
else
MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
$INCLUDE_LOCATION $SHARE_LOCATION $SYSTEM_DS_LOCATION \
Expand All @@ -226,8 +230,7 @@ fi

SHARE_DIRS="$SHARE_LOCATION/examples \
$SHARE_LOCATION/websockify \
$SHARE_LOCATION/esx-fw-vnc \
$SHARE_LOCATION/docker_machine"
$SHARE_LOCATION/esx-fw-vnc"

ETC_DIRS="$ETC_LOCATION/vmm_exec \
$ETC_LOCATION/hm \
Expand Down Expand Up @@ -562,6 +565,10 @@ INSTALL_ONEFLOW_ETC_FILES=(
ONEFLOW_ETC_FILES:$ETC_LOCATION
)

INSTALL_DOCKER_MACHINE_FILES=(
DOCKER_MACHINE_BIN_FILES:$BIN_LOCATION
)

INSTALL_ETC_FILES=(
ETC_FILES:$ETC_LOCATION
EC2_ETC_FILES:$ETC_LOCATION
Expand Down Expand Up @@ -1882,6 +1889,11 @@ ONEFLOW_LIB_MODELS_FILES="src/flow/lib/models/role.rb \
src/flow/lib/models/service_template_pool.rb \
src/flow/lib/models/service_template.rb"

#-----------------------------------------------------------------------------
# Docker Machine files
#-----------------------------------------------------------------------------

DOCKER_MACHINE_BIN_FILES="src/docker_machine/src/docker_machine/bin/docker-machine-driver-opennebula"

#-----------------------------------------------------------------------------
# MAN files
Expand Down Expand Up @@ -1990,6 +2002,8 @@ elif [ "$SUNSTONE" = "yes" ]; then
fi
elif [ "$ONEFLOW" = "yes" ]; then
INSTALL_SET="${INSTALL_ONEFLOW_FILES[@]}"
elif [ "$DOCKER_MACHINE" = "yes" ]; then
INSTALL_SET="${INSTALL_DOCKER_MACHINE_FILES[@]}"
elif [ "$SUNSTONE_DEV" = "no" ]; then
INSTALL_SET="${INSTALL_FILES[@]} \
${INSTALL_SUNSTONE_FILES[@]} ${INSTALL_SUNSTONE_PUBLIC_MINIFIED_FILES[@]}\
Expand Down
2 changes: 1 addition & 1 deletion src/docker_machine/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Import('env')

if env['docker_machine']=='yes':
print "Generating docker-machine-driver-opennebula\n"
exit_code=os.system("./generate.sh")
exit_code=os.system("make -C src/docker_machine build")

if exit_code != 0:
print "Error generating docker-machine-driver-opennebula\n"
Expand Down
8 changes: 0 additions & 8 deletions src/docker_machine/generate.sh

This file was deleted.

52 changes: 13 additions & 39 deletions src/docker_machine/src/docker_machine/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/docker_machine/src/docker_machine/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

required = ["github.com/kolo/xmlrpc", "gopkg.in/xmlpath.v2"]

[[constraint]]
name = "github.com/OpenNebula/one"
branch = "master"

[[constraint]]
name = "github.com/docker/machine"
version = "0.14.0"
Expand Down
33 changes: 21 additions & 12 deletions src/docker_machine/src/docker_machine/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
GODEP_BIN := $(word 1, $(subst :, ,$(GOPATH)))/bin/dep
SHELL := /bin/bash

default: build
BUILD_ID := $(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')
REPO_ROOT ?= $(shell realpath ../../../../)
GOCA_PATH ?= ${REPO_ROOT}/src/oca/go
GOPATH ?= ${REPO_ROOT}/src/docker_machine
USE_LOCAL_GOCA ?= yes

bin/docker-machine-driver-opennebula:
$(GODEP_BIN) ensure
mv vendor/* ..
go build -o ./bin/docker-machine-driver-opennebula ./bin
build: clean bin/docker-machine-driver-opennebula
.PHONY: clean build

clean:
$(RM) bin/docker-machine-driver-opennebula
build: bin/docker-machine-driver-opennebula

bin/docker-machine-driver-opennebula: vendor
GOPATH=$(GOPATH) go build -ldflags "-B 0x$(BUILD_ID)" -o ./bin/docker-machine-driver-opennebula ./bin

install: bin/docker-machine-driver-opennebula
cp -f ./bin/docker-machine-driver-opennebula $(GOPATH)/bin/
vendor:
rm -rf vendor/
GOPATH=$(GOPATH) dep ensure
ifeq ($(USE_LOCAL_GOCA),yes)
set -e; trap 'rm -rf vendor/' ERR; \
rm -rf vendor/github.com/OpenNebula/one; \
ln -s ${REPO_ROOT} vendor/github.com/OpenNebula/one
endif

.PHONY: clean build install
clean:
-rm -rf vendor/ bin/docker-machine-driver-opennebula
3 changes: 2 additions & 1 deletion src/docker_machine/src/docker_machine/opennebula.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (
"io/ioutil"
"strconv"
"time"
"goca"

"github.com/OpenNebula/one/src/oca/go/src/goca"

"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/log"
Expand Down
File renamed without changes.

0 comments on commit a872eb2

Please sign in to comment.