Use local changes to build images 73/64873/1
authorVictor Morales <victor.morales@intel.com>
Wed, 5 Sep 2018 13:44:16 +0000 (06:44 -0700)
committerVictor Morales <victor.morales@intel.com>
Wed, 5 Sep 2018 13:47:08 +0000 (06:47 -0700)
The current implementation is using an external copy of the source
code to buil the docker image. This approach makes hard to debug and
try new changes during development phase. This change allows to sync
local source code folder between host and guest machines.

Change-Id: Ia723499f0e113e5adebb46a0cea6662f703695e5
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-ID: MULTICLOUD-301

.gitignore
vagrant/Vagrantfile
vagrant/installer.sh

index e6cf326..e4c62a1 100644 (file)
@@ -13,6 +13,7 @@ target
 src/github.com
 src/golang.org
 src/k8splugin/vendor
+src/k8splugin/.vendor-new/
 src/k8splugin/kubeconfig/*
 deployments/k8plugin
 
index ba71ba7..61031bb 100644 (file)
@@ -106,6 +106,7 @@ Vagrant.configure("2") do |config|
   config.vm.define :installer, primary: true, autostart: false do |installer|
     installer.vm.hostname = "multicloud"
     installer.vm.network :private_network, :ip => "10.10.10.2", :type => :static
+    installer.vm.synced_folder '../', '/root/go/src/k8-plugin-multicloud/', type: sync_type
     installer.vm.provision 'shell' do |sh|
       sh.path =  "installer.sh"
       sh.args = ['-p', '-v', '-w', '/vagrant']
index b4886f2..5e3b32d 100755 (executable)
@@ -171,23 +171,18 @@ function install_plugin {
 
     mkdir -p /opt/{csar,kubeconfig,consul/config}
     cp $HOME/.kube/config /opt/kubeconfig/krd
-    export CSAR_DIR=/opt/csar
-    export KUBE_CONFIG_DIR=/opt/kubeconfig
-    echo "export CSAR_DIR=${CSAR_DIR}" >> /etc/environment
-    echo "export KUBE_CONFIG_DIR=${KUBE_CONFIG_DIR}" >> /etc/environment
 
     GOPATH=$(go env GOPATH)
-    git clone https://git.onap.org/multicloud/k8s $GOPATH/src/k8-plugin-multicloud
     pushd $GOPATH/src/k8-plugin-multicloud/deployments
     ./build.sh
-    docker-compose up -d
-    popd
 
     if [[ -n "${testing_enabled+x}" ]]; then
+        docker-compose up -d
         pushd $krd_tests
         bash plugin.sh
         popd
     fi
+    popd
 }
 
 # _install_crictl() - Install Container Runtime Interface (CRI) CLI