diff options
-rwxr-xr-x | jjb/armband/armband-deploy.sh | 1 | ||||
-rw-r--r-- | jjb/doctor/doctor.yml | 8 | ||||
-rw-r--r-- | jjb/global/releng-macros.yml | 6 | ||||
-rw-r--r-- | jjb/opera/opera-daily-jobs.yml | 34 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/destroy-env.sh | 2 | ||||
-rw-r--r-- | utils/test/vnfcatalogue/helpers/README.md | 22 | ||||
-rw-r--r-- | utils/test/vnfcatalogue/helpers/migrate.js | 78 | ||||
-rw-r--r-- | utils/test/vnfcatalogue/helpers/schema.js | 51 |
8 files changed, 167 insertions, 35 deletions
diff --git a/jjb/armband/armband-deploy.sh b/jjb/armband/armband-deploy.sh index 6ddd2e961..adabfcaeb 100755 --- a/jjb/armband/armband-deploy.sh +++ b/jjb/armband/armband-deploy.sh @@ -8,7 +8,6 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -set -o errexit set -o nounset set -o pipefail diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index 11b4ffbc2..2333fca14 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -22,10 +22,9 @@ - fuel: slave-label: 'ool-virtual2' pod: 'ool-virtual2' - # TODO(r-mibu): enable this once joid is ready - #- joid: - # slave-label: 'ool-virtual3' - # pod: 'ool-virtual3' + - joid: + slave-label: 'ool-virtual3' + pod: 'ool-virtual3' inspector: - 'sample' @@ -145,6 +144,7 @@ branch: '{branch}' builders: + - 'clean-workspace-log' - 'functest-suite-builder' - shell: | functest_log="$HOME/opnfv/functest/results/{stream}/{project}.log" diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index e6440966a..7e11d92f6 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -423,6 +423,12 @@ sed -r -i '4,$s/^/ /g' lint.log fi +- builder: + name: clean-workspace-log + builders: + - shell: | + find $WORKSPACE -type f -print -name '*.log' | xargs rm -f + - publisher: name: archive-artifacts publishers: diff --git a/jjb/opera/opera-daily-jobs.yml b/jjb/opera/opera-daily-jobs.yml index 47aa2a43d..f1ea1aa74 100644 --- a/jjb/opera/opera-daily-jobs.yml +++ b/jjb/opera/opera-daily-jobs.yml @@ -63,9 +63,6 @@ project: '{project}' branch: '{branch}' - 'huawei-virtual7-defaults' - - 'compass-defaults' - - 'opera-compass-parameter': - gs-pathname: '{gs-pathname}' builders: - description-setter: @@ -84,7 +81,10 @@ condition: SUCCESSFUL projects: - name: 'compass-deploy-virtual-daily-{stream}' - current-parameters: true + current-parameters: false + predefined-parameters: | + DEPLOY_SCENARIO=os-nosdn-openo-noha + COMPASS_OS_VERSION=xenial node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -93,7 +93,7 @@ # condition: SUCCESSFUL # projects: # - name: 'functest-compass-baremetal-suite-{stream}' -# current-parameters: true +# current-parameters: false # predefined-parameters: # FUNCTEST_SUITE_NAME=opera # node-parameters: true @@ -145,27 +145,3 @@ #!/bin/bash echo "Hello world!" -######################## -# parameter macros -######################## -- parameter: - name: opera-compass-parameter - parameters: - - string: - name: BUILD_DIRECTORY - default: $WORKSPACE/build_output - description: "Directory where the build artifact will be located upon the completion of the build." - - string: - name: GS_URL - default: '$GS_BASE{gs-pathname}' - description: "URL to Google Storage." - - choice: - name: COMPASS_OPENSTACK_VERSION - choices: - - 'newton' - - string: - name: DEPLOY_SCENARIO - default: 'os-nosdn-openo-noha' - - string: - name: COMPASS_OS_VERSION - default: 'xenial' diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh index 9920046e1..f6c66a876 100755 --- a/prototypes/bifrost/scripts/destroy-env.sh +++ b/prototypes/bifrost/scripts/destroy-env.sh @@ -33,7 +33,7 @@ fi echo "removing leases" [[ -e /var/lib/misc/dnsmasq/dnsmasq.leases ]] && > /var/lib/misc/dnsmasq/dnsmasq.leases echo "removing logs" -rm -rf /var/log/libvirt/baremetal_logs/*.log +rm -rf /var/log/libvirt/baremetal_logs/* # clean up dib images only if requested explicitly CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false} diff --git a/utils/test/vnfcatalogue/helpers/README.md b/utils/test/vnfcatalogue/helpers/README.md new file mode 100644 index 000000000..6c0ca78c3 --- /dev/null +++ b/utils/test/vnfcatalogue/helpers/README.md @@ -0,0 +1,22 @@ +# Helper Directory + +## Helper to migrate database + +First make sure nodejs and mysql are installed. Then use + +```bash +npm install bookshelf mysql knex when lodash --save +``` + +Create a database named **vnf_catalogue**. +Enter the mysql credentials in migrate.js. + +Then use + +```bash +node migrate +``` + +If successful the script will return success message. The current script is +idempotent is nature, if run twice it will just return error and write nothing. + diff --git a/utils/test/vnfcatalogue/helpers/migrate.js b/utils/test/vnfcatalogue/helpers/migrate.js new file mode 100644 index 000000000..ec209053c --- /dev/null +++ b/utils/test/vnfcatalogue/helpers/migrate.js @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2017 Kumar Rishabh(penguinRaider) and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + +var knex = require('knex')({ + client: 'mysql', + connection: { + host : 'localhost', + user : '*', + password : '*', + database : 'vnf_catalogue', + charset : 'utf8' + } +}); +var Schema = require('./schema'); +var sequence = require('when/sequence'); +var _ = require('lodash'); +function createTable(tableName) { + return knex.schema.createTable(tableName, function (table) { + var column; + var columnKeys = _.keys(Schema[tableName]); + _.each(columnKeys, function (key) { + if (Schema[tableName][key].type === 'text' && Schema[tableName][key].hasOwnProperty('fieldtype')) { + column = table[Schema[tableName][key].type](key, Schema[tableName][key].fieldtype); + } + else if (Schema[tableName][key].type === 'string' && Schema[tableName][key].hasOwnProperty('maxlength')) { + column = table[Schema[tableName][key].type](key, Schema[tableName][key].maxlength); + } + else { + column = table[Schema[tableName][key].type](key); + } + if (Schema[tableName][key].hasOwnProperty('nullable') && Schema[tableName][key].nullable === true) { + column.nullable(); + } + else { + column.notNullable(); + } + if (Schema[tableName][key].hasOwnProperty('primary') && Schema[tableName][key].primary === true) { + column.primary(); + } + if (Schema[tableName][key].hasOwnProperty('unique') && Schema[tableName][key].unique) { + column.unique(); + } + if (Schema[tableName][key].hasOwnProperty('unsigned') && Schema[tableName][key].unsigned) { + column.unsigned(); + } + if (Schema[tableName][key].hasOwnProperty('references')) { + column.references(Schema[tableName][key].references); + } + if (Schema[tableName][key].hasOwnProperty('defaultTo')) { + column.defaultTo(Schema[tableName][key].defaultTo); + } + }); + }); +} +function createTables () { + var tables = []; + var tableNames = _.keys(Schema); + tables = _.map(tableNames, function (tableName) { + return function () { + return createTable(tableName); + }; + }); + return sequence(tables); +} +createTables() +.then(function() { + console.log('Tables created!!'); + process.exit(0); +}) +.catch(function (error) { + throw error; +}); diff --git a/utils/test/vnfcatalogue/helpers/schema.js b/utils/test/vnfcatalogue/helpers/schema.js new file mode 100644 index 000000000..2aaf99ae2 --- /dev/null +++ b/utils/test/vnfcatalogue/helpers/schema.js @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2017 Kumar Rishabh(penguinRaider) and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ +var Schema = { + photo: { + photo_id: {type: 'increments', nullable: false, primary: true}, + photo_url: {type: 'string', maxlength: 254, nullable: false} + }, + user: { + user_id: {type: 'increments', nullable: false, primary: true}, + user_name: {type: 'string', maxlength: 254, nullable: false}, + password: {type: 'string', maxlength: 150, nullable: false}, + email_id: {type: 'string', maxlength: 254, nullable: false, unique: true, validations: {isEmail: true}}, + photo_id: {type: 'integer', nullable: true, unsigned: true, references: 'photo.photo_id'}, + company: {type: 'string', maxlength: 254, nullable: false}, + introduction: {type: 'string', maxlength: 510, nullable: false}, + last_login: {type: 'dateTime', nullable: true}, + created_at: {type: 'dateTime', nullable: false}, + }, + vnf: { + vnf_id: {type: 'increments', nullable: false, primary: true}, + vnf_name: {type: 'string', maxlength: 254, nullable: false}, + repo_url: {type: 'string', maxlength: 254, nullable: false}, + photo_id: {type: 'integer', nullable: true, unsigned: true, references: 'photo.photo_id'}, + submitter_id: {type: 'integer', nullable: false, unsigned: true, references: 'user.user_id'}, + lines_of_code: {type: 'integer', nullable: true, unsigned: true}, + versions: {type: 'integer', nullable: true, unsigned: true}, + no_of_developers: {type: 'integer', nullable: true, unsigned: true}, + }, + tag: { + tag_id: {type: 'increments', nullable: false, primary: true}, + name: {type: 'string', maxlength: 150, nullable: false} + }, + vnf_tags: { + vnf_tag_id: {type: 'increments', nullable: false, primary: true}, + tag_id: {type: 'integer', nullable: false, unsigned: true, references: 'tag.tag_id'}, + vnf_id: {type: 'integer', nullable: false, unsigned: true, references: 'vnf.vnf_id'}, + }, + vnf_contributors: { + vnf_contributors_id: {type: 'increments', nullable: false, primary: true}, + user_id: {type: 'integer', nullable: false, unsigned: true, references: 'user.user_id'}, + vnf_id: {type: 'integer', nullable: false, unsigned: true, references: 'vnf.vnf_id'}, + created_at: {type: 'dateTime', nullable: false}, + } +}; +module.exports = Schema; |