Merge "Add document dir into framework"
authorxinhuili <lxinhui@vmware.com>
Mon, 11 Sep 2017 16:10:52 +0000 (16:10 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 11 Sep 2017 16:10:52 +0000 (16:10 +0000)
multivimbroker/docker/build-image.sh
multivimbroker/multivimbroker/forwarder/base.py
multivimbroker/multivimbroker/pub/config/config.py
multivimbroker/multivimbroker/pub/utils/syscomm.py
multivimbroker/multivimbroker/swagger/multivim.identity.swagger.json
multivimbroker/pom.xml

index b6f4dd4..73a8db6 100644 (file)
@@ -1,6 +1,32 @@
 #!/bin/bash
+DIRNAME=`dirname $0`
+DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd`
+echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
+cd ${DOCKER_BUILD_DIR}
 
-IMAGE="multicloud-framework"
-VERSION="latest"
+BUILD_ARGS="--no-cache"
+ORG="onap"
+VERSION="1.0.0-SNAPSHOT"
+PROJECT="multicloud"
+IMAGE="framework"
+DOCKER_REPOSITORY="nexus3.onap.org:10003"
+IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
 
-docker build -t ${IMAGE}:${VERSION} .
\ No newline at end of file
+if [ $HTTP_PROXY ]; then
+    BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
+fi
+if [ $HTTPS_PROXY ]; then
+    BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
+fi
+
+function build_image {
+    docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
+}
+
+function push_image {
+    docker push ${IMAGE_NAME}:${VERSION}
+    docker push ${IMAGE_NAME}:latest
+}
+
+build_image
+push_image
\ No newline at end of file
index c96461a..7477842 100644 (file)
@@ -53,7 +53,6 @@ class BaseHandler(object):
 
         try:
             url = getMultivimDriver(vimid, full_path=full_path)
-
         except exceptions.VimBrokerException as e:
             logging.exception("vimbroker exception: %s" % e)
             return HttpResponse(e.content, status=e.status_code)
index 71b4d2a..72932dd 100644 (file)
@@ -40,8 +40,8 @@ REDIS_PASSWD = ''
 REG_TO_MSB_WHEN_START = False
 REG_TO_MSB_REG_URL = "/api/microservices/v1/services"
 REG_TO_MSB_REG_PARAM = {
-    "serviceName": "multivim",
-    "version": "v1",
+    "serviceName": "multicloud",
+    "version": "v0",
     "url": "/api/multicloud/v0",
     "protocol": "REST",
     "visualRange": "1",
index 0d0419a..cdc6480 100644 (file)
@@ -37,25 +37,21 @@ def findMultivimDriver(vim=None):
 
     if vim and vim["type"] == "openstack":
         if vim["version"] == "kilo":
-            multivimdriver = "multivim-kilo"
+            multivimdriver = "multicloud-kilo"
         elif vim["version"] == "newton":
-            multivimdriver = "multivim-newton"
+            multivimdriver = "multicloud-newton"
         else:
             # if vim type is openstack, use latest "newton" version as default
-            multivimdriver = "multivim-newton"
+            multivimdriver = "multicloud-newton"
     elif vim and vim["type"] == "vmware":
-        multivimdriver = "multivim-vio"
+            multivimdriver = "multicloud-vio"
     else:
         raise exceptions.NotFound("Not support VIM type")
     return multivimdriver
 
 
 def getMultivimDriver(vimid, full_path=""):
-
-    multivim = "multivim"
+    multcloud = "multicloud"
     vim = get_vim_by_id(vimid)
-    if vim["type"] and vim["version"]:
-        pass
-
-    multivimdriver = findMultivimDriver(vim=vim)
-    return re.sub(multivim, multivimdriver, full_path)
+    multclouddriver = findMultivimDriver(vim=vim)
+    return re.sub(multcloud, multclouddriver, full_path)
index 923924e..a81b431 100644 (file)
@@ -4,7 +4,7 @@
         "version": "1.0.0",
         "title": "MultiVIM Service rest API"
     },
-    "basePath": "/openoapi/multivim/v1/",
+    "basePath": "/api/multicloud/v0/",
     "tags": [
         {
             "name": "MultiVIM services"
index 8affa09..560b1b1 100644 (file)
             </plugin>
         </plugins>
     </build>
-    <profiles>
-        <profile>
-            <id>docker</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>io.fabric8</groupId>
-                        <artifactId>docker-maven-plugin</artifactId>
-                        <version>0.16.5</version>
-                        <inherited>false</inherited>
-                        <configuration>
-                            <images>
-                                <image>
-                                    <name>onap/multicloud/multicloud-framework</name>
-                                    <build>
-                                        <cleanup>try</cleanup>
-                                        <dockerFileDir>${basedir}/docker/</dockerFileDir>
-                                        <dockerFile>${basedir}/docker/Dockerfile</dockerFile>
-                                        <tags>
-                                            <tag>${project.version}-STAGING-latest</tag>
-                                        </tags>
-                                    </build>
-                                </image>
-                            </images>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <id>generate-images</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                </goals>
-                            </execution>
-                            <execution>
-                                <id>push-images</id>
-                                <phase>deploy</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                    <goal>push</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
 </project>
\ No newline at end of file