Merge "change path to retrieve joid creds on CI production labs"
authorMorgan Richomme <morgan.richomme@orange.com>
Fri, 18 Dec 2015 07:54:33 +0000 (07:54 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Fri, 18 Dec 2015 07:54:34 +0000 (07:54 +0000)
jjb/apex/apex.yml
jjb/apex/opnfv-apex.yml
jjb/compass4nfv/compass4nfv.yml
jjb/compass4nfv/opnfv-compass4nfv.yml
jjb/fuel/opnfv-fuel.yml
jjb/joid/joid-deploy.sh
jjb/joid/joid.yml
jjb/opnfv/installer-params.yml
jjb/opnfv/pod-params.yml
jjb/vswitchperf/vswitchperf.yml
utils/docs-build.sh

index 14c472b..45f7704 100644 (file)
             # cleanup virtual machines before we start
             sudo opnfv-clean
             # initiate virtual deployment
-            sudo opnfv-deploy -v
+            sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example
 
             echo
             echo "--------------------------------------------------------"
index de2947c..5240bba 100644 (file)
@@ -80,5 +80,5 @@
     builders:
         - shell: |
             #!/bin/bash
-            echo "Hello World from OPNFV $INSTALLER_NAME"
-            echo "Running $INSTALLER_NAME with controller $CONTROLLER"
+            echo "Hello World from OPNFV $INSTALLER_TYPE"
+            echo "Running $INSTALLER_TYPE with controller $CONTROLLER"
index 3ef252f..3645bbb 100644 (file)
 
     builders:
         - trigger-builds:
-          - project: 'compass-build-iso'
+          - project: 'compass-build-iso-{stream}'
             git-revision: true
             block: true
         - trigger-builds:
             name: PPA_CACHE
             default: "$WORKSPACE/work/repo/"
         - choice:
-            name: COMPASS-OPENSTACK-VERSION
+            name: COMPASS_OPENSTACK_VERSION
             choices:
                 - 'liberty'
                 - 'juno'
         - choice:
-            name: COMPASS-OS-VERSION
+            name: COMPASS_OS_VERSION
             choices:
                 - 'ubuntu-trusty'
                 - 'rhel7'
             export EXTERNAL_NIC=vnic_ci
             cd $WORKSPACE
 
+            export OS_VERSION=${COMPASS_OS_VERSION}
+            export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}
             ./deploy.sh $FLAVOR_CONF
             if [ $? -ne 0 ]; then
                 echo "depolyment failed!"
             echo "Done!"
 
             ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
-            sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./  &> /dev/null
+            sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./  &> /dev/null
 
             exit $deploy_ret
 
 
             cd $WORKSPACE
 
-            export OS_VERSION=${COMPASS-OS-VERSION}
-            export OPENSTACK_VERSION=${COMPASS-OPENSTACK-VERSION}
+            export OS_VERSION=${COMPASS_OS_VERSION}
+            export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}
             ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
             if [ $? -ne 0 ]; then
                 echo "depolyment failed!"
             echo "Done!"
 
             ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
-            sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS-OPENSTACK-VERSION}-opnfv2/ansible.log ./  &> /dev/null
+            sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./  &> /dev/null
 
             exit $deploy_ret
 
index c647abc..288c7ab 100644 (file)
@@ -80,5 +80,5 @@
     builders:
         - shell: |
             #!/bin/bash
-            echo "Hello World from OPNFV $INSTALLER_NAME"
-            echo "Running $INSTALLER_NAME with controller $CONTROLLER"
+            echo "Hello World from OPNFV $INSTALLER_TYPE"
+            echo "Running $INSTALLER_TYPE with controller $CONTROLLER"
index a0fbce2..393f919 100644 (file)
     builders:
         - shell: |
             #!/bin/bash
-            echo "Hello World from OPNFV $INSTALLER_NAME"
-            echo "Running $INSTALLER_NAME with controller $CONTROLLER"
+            echo "Hello World from OPNFV $INSTALLER_TYPE"
+            echo "Running $INSTALLER_TYPE with controller $CONTROLLER"
index d9ce86e..b7bc32d 100644 (file)
@@ -2,10 +2,12 @@
 set +e
 set -o nounset
 
+JOID_LOCAL_CONFIG_FOLDER=$HOME/joid_config
+JOID_ADMIN_OPENRC=$JOID_LOCAL_CONFIG_FOLDER/admin-openrc
+
 ####### Temporary - to be done with jenkins params #####
 JOID_MODE=ha
 JOID_RELEASE=liberty
-JOID_LOCAL_CONFIG_FOLDER=~/joid_config
 JOID_SDN_CONTROLLER=odl
 #################
 
@@ -33,7 +35,6 @@ else
     export OS_ADMIN_PASSWORD=openstack
     export CEPH_DISKS=/srv
     export CEPH_REFORMAT=no
-    export JOID_ADMIN_OPENRC=$WORKSPACE/admin_openrc.sh
 fi
 
 ##
@@ -47,8 +48,8 @@ if [ -e "$JOID_LOCAL_CONFIG_FOLDER/environments.yaml" ] && [ "$MAAS_REINSTALL" =
 else
     MAASCONFIG=$WORKSPACE/ci/maas/$POD_DC/$POD_NUM/deployment.yaml
     echo "------ Set MAAS password ------"
-    sed -i -- 's/user: ubuntu/user: $MAAS_USER/' $MAASCONFIG
-    sed -i -- 's/password: ubuntu/password: $MAAS_PASSWORD/' $MAASCONFIG
+    sed -i -- "s/user: ubuntu/user: $MAAS_USER/" $MAASCONFIG
+    sed -i -- "s/password: ubuntu/password: $MAAS_PASSWORD/" $MAASCONFIG
     echo "------ Redeploy MAAS ------"
     ./02-maasdeploy.sh $POD_NAME
 fi
@@ -86,9 +87,16 @@ echo "Execute: ./deploy.sh -t $JOID_MODE -o $JOID_RELEASE -s $JOID_SDN_CONTROLLE
 ## Set Admin RC
 ##
 
-echo "------ Create OpenRC file ------"
-KEYSTONE=$(cat bundle.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip)
+echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------"
+KEYSTONE=$(cat bundles.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip)
+
+# create the folder if needed
+JOID_ADMIN_OPENRC_FOLDER=$(echo $JOID_ADMIN_OPENRC | perl -pe "s|^(.*/).*?$|\1|")
+if [ ! -d "$JOID_ADMIN_OPENRC_FOLDER" ]; then
+    mkdir -p $JOID_ADMIN_OPENRC_FOLDER
+fi
 
+# export the openrc file
 cat << EOF > $JOID_ADMIN_OPENRC
 export OS_USERNAME=admin
 export OS_PASSWORD=$OS_ADMIN_PASSWORD
@@ -97,6 +105,10 @@ export OS_AUTH_URL=http://$KEYSTONE:5000/v2.0
 export OS_REGION_NAME=Canonical
 EOF
 
+##
+## Backup local juju env
+##
+
 if [ -d "$JOID_LOCAL_CONFIG_FOLDER" ]; then
     echo "------ Backup Juju environment ------"
     cp environments.yaml $JOID_LOCAL_CONFIG_FOLDER/
index fdeddc6..28b019f 100644 (file)
@@ -88,7 +88,7 @@
     builders:
         - shell: |
             #!/bin/bash
-            echo "Running $INSTALLER_NAME with controller $CONTROLLER"
+            echo "Running $INSTALLER_TYPE with controller $CONTROLLER"
             echo "Please note that this is a quick try to see how joid deployment works"
             echo
             echo "Executing clean.sh"
     builders:
         - shell: |
             #!/bin/bash
-            echo "Running $INSTALLER_NAME with controller $CONTROLLER"
+            echo "Running $INSTALLER_TYPE with controller $CONTROLLER"
             echo "Please note that this is WIP generic builder"
             echo
             echo "Executing clean.sh"
index 8e1cf9e..64945c6 100644 (file)
@@ -5,13 +5,9 @@
             name: INSTALLER_IP
             default: '192.168.X.X'
             description: 'IP of the installer'
-        - string:
-            name: INSTALLER_NAME
-            default: apex
-            description: 'Installer used for deploying OPNFV on this POD'
         - string:
             name: INSTALLER_TYPE
-            default: $INSTALLER_NAME
+            default: apex
             description: 'Installer used for deploying OPNFV on this POD'
 
 - parameter:
             name: INSTALLER_IP
             default: '192.168.200.2'
             description: 'IP of the installer'
-        - string:
-            name: INSTALLER_NAME
-            default: compass4nfv
-            description: 'Installer used for deploying OPNFV on this POD'
         - string:
             name: INSTALLER_TYPE
-            default: $INSTALLER_NAME
+            default: compass
             description: 'Installer used for deploying OPNFV on this POD'
 
 - parameter:
@@ -38,7 +30,7 @@
             default: '10.20.0.2'
             description: 'IP of the installer'
         - string:
-            name: INSTALLER_NAME
+            name: INSTALLER_TYPE
             default: fuel
             description: 'Installer used for deploying OPNFV on this POD'
 
             name: INSTALLER_IP
             default: '192.168.Y.Y'
             description: 'IP of the installer'
-        - string:
-            name: INSTALLER_NAME
-            default: joid
-            description: 'Installer used for deploying OPNFV on this POD'
         - string:
             name: INSTALLER_TYPE
-            default: $INSTALLER_NAME
+            default: joid
             description: 'Installer used for deploying OPNFV on this POD'
index bb5e529..e36a0b6 100644 (file)
             default: /root/.ssh/id_rsa
             description: 'SSH key to use for Apex'
 
+- parameter:
+    name: 'intel-pod3-defaults'
+    parameters:
+        - node:
+            name: SLAVE_NAME
+            description: 'Slave name on Jenkins'
+            allowed-slaves:
+                - intel-pod3
+            default-slaves:
+                - intel-pod3
+        - string:
+            name: GIT_BASE
+            default: https://gerrit.opnfv.org/gerrit/$PROJECT
+            description: 'Git URL to use on the jumphost'
+
 - parameter:
     name: 'intel-pod5-defaults'
     parameters:
index b4bc70f..a06507a 100644 (file)
@@ -1,37 +1,31 @@
 - project:
+
     name: vswitchperf
+
+    project: '{name}'
+
     jobs:
-        - 'vswitchperf-daily-{stream}'
-        - 'vswitchperf-merge-{stream}'
         - 'vswitchperf-verify-{stream}'
+        - 'vswitchperf-merge-{stream}'
+        - 'vswitchperf-daily-{stream}'
 
-    # stream:    branch with - in place of / (eg. stable-helium)
-    # branch:    branch (eg. stable/helium)
+# only master branch is enabled at the moment to keep no of jobs sane
     stream:
         - master:
             branch: 'master'
-
-    project: 'vswitchperf'
-    somevar: 'foo'
+            gs-pathname: ''
+#        - brahmaputra:
+#            branch: 'stable/brahmaputra'
+#            gs-pathname: '/brahmaputra'
 
 - job-template:
-    name: 'vswitchperf-daily-{stream}'
 
-    # Job template for daily builders
-    #
-    # Required Variables:
-    #     stream:    branch with - in place of / (eg. stable)
-    #     branch:    branch (eg. stable)
-
-    varsetabove: '{somevar}'
-    node: opnfv-build
+    name: 'vswitchperf-daily-{stream}'
 
     parameters:
         - project-parameter:
             project: '{project}'
-        - string:
-            name: GIT_BASE
-            default: https://gerrit.opnfv.org/gerrit/vswitchperf
+        - 'intel-pod3-defaults'
 
     scm:
         - git-scm:
@@ -42,9 +36,6 @@
     triggers:
         - timed: 'H H * * *'
 
-    prebuilders:
-        - test-macro
-
     builders:
         - shell: |
             pwd
             # run basic sanity test
             make sanity
 
-    postbuilders:
-        - test-macro
-
 - job-template:
     name: 'vswitchperf-verify-{stream}'
 
     project-type: freestyle
 
-    node: opnfv-build
-
     concurrent: true
 
     properties:
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
-            branch: 'master'
-        - string:
-            name: GIT_BASE
-            default: https://gerrit.opnfv.org/gerrit/vswitchperf
+            branch: '{branch}'
+        - 'opnfv-build-defaults'
+
     scm:
         - gerrit-trigger-scm:
             credentials-id: '{ssh-credentials}'
                     comment-contains-value: 'reverify'
             projects:
               - project-compare-type: 'ANT'
-                project-pattern: 'vswitchperf'
+                project-pattern: '{project}'
                 branches:
                   - branch-compare-type: 'ANT'
-                    branch-pattern: '**/master'
+                    branch-pattern: '**/{branch}'
                 forbidden-file-paths:
                   - compare-type: ANT
                     pattern: 'docs/**'
 - job-template:
     name: 'vswitchperf-merge-{stream}'
 
-    # builder-merge job to run JJB update
-    #
-    # This job's purpose is to update all the JJB
-
     project-type: freestyle
 
-    node: opnfv-build
-
     concurrent: true
 
     properties:
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
-            branch: 'master'
-        - string:
-            name: GIT_BASE
-            default: https://gerrit.opnfv.org/gerrit/vswitchperf
+            branch: '{branch}'
+        - 'opnfv-build-defaults'
 
     scm:
         - gerrit-trigger-scm:
                     comment-contains-value: 'remerge'
             projects:
               - project-compare-type: 'ANT'
-                project-pattern: 'vswitchperf'
+                project-pattern: '{project}'
                 branches:
                     - branch-compare-type: 'ANT'
-                      branch-pattern: '**/master'
+                      branch-pattern: '**/{branch}'
                 forbidden-file-paths:
                   - compare-type: ANT
                     pattern: 'docs/**'
index 5ac8b2b..fc607fa 100755 (executable)
@@ -84,6 +84,34 @@ function add_config() {
     fi
 }
 
+function is_top_dir() {
+    [[ "$1" == "$SRC_DIR" ]]
+}
+
+function generate_name_for_top_dir() {
+    for suffix in '' '.top' '.all' '.master' '_' '__' '___'
+    do
+        _name="$(basename $SRC_DIR)$suffix"
+        [[ -e "$SRC_DIR/$_name" ]] && continue
+        echo "$_name"
+        return
+    done
+
+    echo "Error: cannot find name for top directory [$SRC_DIR]"
+    exit 1
+}
+
+function generate_name() {
+    _dir=$1
+
+    if is_top_dir "$_dir" ; then
+        _name=$(generate_name_for_top_dir $SRC_DIR)
+    else
+        _name="${_dir#$SRC_DIR/}"
+    fi
+    # Replace '/' by '_'
+    echo "${_name////_}"
+}
 
 check_rst_doc $SRC_DIR
 
@@ -94,7 +122,7 @@ fi
 
 find $SRC_DIR -name $INDEX_RST -printf '%h\n' | while read dir
 do
-    name="${dir##*/}"
+    name=$(generate_name $dir)
     src="$BUILD_DIR/src/$name"
     build="$BUILD_DIR/$name"
     output="$OUTPUT_DIR/$name"
@@ -143,4 +171,9 @@ do
         [[ -n "$GERRIT_COMMENT" ]] && echo "$msg" >> "$GERRIT_COMMENT"
     }
 
+    if is_top_dir "$dir" ; then
+        mv "$output"/* "$OUTPUT_DIR"/
+        rm -rf "$output"
+    fi
+
 done