From f237c7b95134621c0a32eda31f186c53bfcd2e46 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Fri, 8 Sep 2017 08:43:19 +0200 Subject: [PATCH] Remove VNF catalogue from releng It has been transfered to sample vnf repo [1] [1]: https://git.opnfv.org/samplevnf/tree/VNF_Catalogue Change-Id: I418151bd24517efeb66fc0ae76cb9e091bd130f6 Signed-off-by: Morgan Richomme --- .../test/vnfcatalogue/VNF_Catalogue/.dockerignore | 2 - utils/test/vnfcatalogue/VNF_Catalogue/Dockerfile | 35 - utils/test/vnfcatalogue/VNF_Catalogue/README.md | 18 - utils/test/vnfcatalogue/VNF_Catalogue/app.js | 95 - utils/test/vnfcatalogue/VNF_Catalogue/bin/www | 9 - utils/test/vnfcatalogue/VNF_Catalogue/database.js | 23 - .../vnfcatalogue/VNF_Catalogue/docker-compose.yml | 49 - .../vnfcatalogue/VNF_Catalogue/docker_commands.sh | 2 - .../migration/3rd_party/wait-for-it/LICENSE | 20 - .../migration/3rd_party/wait-for-it/README.md | 75 - .../migration/3rd_party/wait-for-it/wait-for-it.sh | 161 - .../VNF_Catalogue/migration/Dockerfile | 34 - .../VNF_Catalogue/migration/migrate.js | 86 - .../VNF_Catalogue/migration/package.json | 15 - .../vnfcatalogue/VNF_Catalogue/migration/schema.js | 57 - utils/test/vnfcatalogue/VNF_Catalogue/package.json | 27 - .../public/3rd_party/materialize/.DS_Store | Bin 6148 -> 0 bytes .../public/3rd_party/materialize/LICENSE | 21 - .../public/3rd_party/materialize/README.md | 49 - .../3rd_party/materialize/css/materialize.css | 8582 -------------------- .../3rd_party/materialize/css/materialize.min.css | 16 - .../public/3rd_party/materialize/fonts/.DS_Store | Bin 6148 -> 0 bytes .../materialize/fonts/roboto/Roboto-Bold.eot | Bin 20966 -> 0 bytes .../materialize/fonts/roboto/Roboto-Bold.ttf | Bin 127744 -> 0 bytes .../materialize/fonts/roboto/Roboto-Bold.woff | Bin 62876 -> 0 bytes .../materialize/fonts/roboto/Roboto-Bold.woff2 | Bin 49976 -> 0 bytes .../materialize/fonts/roboto/Roboto-Light.eot | Bin 20940 -> 0 bytes .../materialize/fonts/roboto/Roboto-Light.ttf | Bin 126792 -> 0 bytes .../materialize/fonts/roboto/Roboto-Light.woff | Bin 62316 -> 0 bytes .../materialize/fonts/roboto/Roboto-Light.woff2 | Bin 49380 -> 0 bytes .../materialize/fonts/roboto/Roboto-Medium.eot | Bin 21364 -> 0 bytes .../materialize/fonts/roboto/Roboto-Medium.ttf | Bin 127488 -> 0 bytes .../materialize/fonts/roboto/Roboto-Medium.woff | Bin 62980 -> 0 bytes .../materialize/fonts/roboto/Roboto-Medium.woff2 | Bin 50224 -> 0 bytes .../materialize/fonts/roboto/Roboto-Regular.eot | Bin 21320 -> 0 bytes .../materialize/fonts/roboto/Roboto-Regular.ttf | Bin 126072 -> 0 bytes .../materialize/fonts/roboto/Roboto-Regular.woff | Bin 61736 -> 0 bytes .../materialize/fonts/roboto/Roboto-Regular.woff2 | Bin 49236 -> 0 bytes .../materialize/fonts/roboto/Roboto-Thin.eot | Bin 21659 -> 0 bytes .../materialize/fonts/roboto/Roboto-Thin.ttf | Bin 127584 -> 0 bytes .../materialize/fonts/roboto/Roboto-Thin.woff | Bin 61628 -> 0 bytes .../materialize/fonts/roboto/Roboto-Thin.woff2 | Bin 48524 -> 0 bytes .../public/3rd_party/materialize/js/materialize.js | 8031 ------------------ .../3rd_party/materialize/js/materialize.min.js | 10 - .../VNF_Catalogue/public/3rd_party/typeahead.js | 7 - .../public/images/3rd_party/commits.png | Bin 1437 -> 0 bytes .../VNF_Catalogue/public/images/logo.png | Bin 12138 -> 0 bytes .../VNF_Catalogue/public/javascripts/global.js | 87 - .../VNF_Catalogue/public/javascripts/mode_edit.js | 82 - .../public/javascripts/search_results.js | 12 - .../public/stylesheets/3rd_party/bootstrap.css | 6757 --------------- .../public/stylesheets/project_profile.css | 12 - .../public/stylesheets/search_form.css | 58 - .../public/stylesheets/search_projects.css | 112 - .../VNF_Catalogue/public/stylesheets/style.css | 301 - .../VNF_Catalogue/public/uploads/logo.png | Bin 12138 -> 0 bytes .../VNF_Catalogue/routes/add_project.js | 116 - .../vnfcatalogue/VNF_Catalogue/routes/add_tag.js | 52 - .../vnfcatalogue/VNF_Catalogue/routes/index.js | 18 - .../VNF_Catalogue/routes/project_profile.js | 19 - .../VNF_Catalogue/routes/search_projects.js | 94 - .../VNF_Catalogue/routes/search_tag.js | 36 - .../VNF_Catalogue/routes/search_vnf.js | 36 - .../VNF_Catalogue/routes/vnf_tag_association.js | 55 - .../VNF_Catalogue/views/add_project.jade | 164 - .../vnfcatalogue/VNF_Catalogue/views/error.jade | 12 - .../vnfcatalogue/VNF_Catalogue/views/index.jade | 123 - .../vnfcatalogue/VNF_Catalogue/views/layout.jade | 54 - .../VNF_Catalogue/views/project_profile.jade | 84 - .../vnfcatalogue/VNF_Catalogue/views/search.jade | 5 - .../VNF_Catalogue/views/search_projects.jade | 83 - .../VNF_Catalogue/views/vnf_tag_association.jade | 167 - utils/test/vnfcatalogue/cronjobs/README.md | 24 - utils/test/vnfcatalogue/cronjobs/database.js | 14 - utils/test/vnfcatalogue/cronjobs/github.js | 129 - utils/test/vnfcatalogue/helpers/README.md | 22 - utils/test/vnfcatalogue/helpers/migrate.js | 86 - utils/test/vnfcatalogue/helpers/schema.js | 57 - 78 files changed, 26295 deletions(-) delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/.dockerignore delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/Dockerfile delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/README.md delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/app.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/bin/www delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/database.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/docker-compose.yml delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/docker_commands.sh delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/LICENSE delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/README.md delete mode 100755 utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/wait-for-it.sh delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/migration/Dockerfile delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/migration/migrate.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/migration/package.json delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/migration/schema.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/package.json delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/.DS_Store delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/LICENSE delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/README.md delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/css/materialize.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/css/materialize.min.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/.DS_Store delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Bold.eot delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Bold.ttf delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Bold.woff delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Bold.woff2 delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Light.eot delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Light.ttf delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Light.woff delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Light.woff2 delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Medium.eot delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Medium.ttf delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Medium.woff delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Medium.woff2 delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Regular.eot delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Regular.ttf delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Regular.woff delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Regular.woff2 delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Thin.eot delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Thin.ttf delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Thin.woff delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/fonts/roboto/Roboto-Thin.woff2 delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/js/materialize.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/js/materialize.min.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/typeahead.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/images/3rd_party/commits.png delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/images/logo.png delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/javascripts/global.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/javascripts/mode_edit.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/javascripts/search_results.js delete mode 100755 utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/3rd_party/bootstrap.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/project_profile.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/search_form.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/search_projects.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/style.css delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/public/uploads/logo.png delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/add_project.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/add_tag.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/index.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/project_profile.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/search_projects.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/search_tag.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/search_vnf.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/routes/vnf_tag_association.js delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/add_project.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/error.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/index.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/layout.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/project_profile.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/search.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/search_projects.jade delete mode 100644 utils/test/vnfcatalogue/VNF_Catalogue/views/vnf_tag_association.jade delete mode 100644 utils/test/vnfcatalogue/cronjobs/README.md delete mode 100644 utils/test/vnfcatalogue/cronjobs/database.js delete mode 100644 utils/test/vnfcatalogue/cronjobs/github.js delete mode 100644 utils/test/vnfcatalogue/helpers/README.md delete mode 100644 utils/test/vnfcatalogue/helpers/migrate.js delete mode 100644 utils/test/vnfcatalogue/helpers/schema.js diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/.dockerignore b/utils/test/vnfcatalogue/VNF_Catalogue/.dockerignore deleted file mode 100644 index 93f136199..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -npm-debug.log diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/Dockerfile b/utils/test/vnfcatalogue/VNF_Catalogue/Dockerfile deleted file mode 100644 index 5df8eb5da..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -############################################# -# Docker container for VNF_Catalogue WebApp -############################################# -# Purpose: Don't run it from here! Use docker-compose(See README.md) -# -# Maintained by Kumar Rishabh :: penguinRaider -## -# 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 -# - -FROM node:boron -MAINTAINER KumarRishabh::penguinRaider -LABEL version="v0.0.1" description="Open Source VNF_Catalogue for OPNFV" - -ENV DB_HOST mysql -ENV DB_USER vnf_user -ENV DB_PASSWORD vnf_password -ENV DB_DATABASE vnf_catalogue - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -COPY package.json /usr/src/app/ - -RUN npm install - -COPY . /usr/src/app - -EXPOSE 3000 - -# We wait for mysql service to come up before starting the server using a 3rd_party script. -CMD [ "./migration/3rd_party/wait-for-it/wait-for-it.sh", "mysql:3306", "-t", "0", "--", "npm", "start" ] diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/README.md b/utils/test/vnfcatalogue/VNF_Catalogue/README.md deleted file mode 100644 index 91179f514..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/README.md +++ /dev/null @@ -1,18 +0,0 @@ -#VNF_Catalogue Nodejs + Jade + MySql server - - -## Quickstart - -First install docker and docker-compose. This multicontainer app uses -docker-compose to organize the vnf_catalogue web_app - -The use - ```docker-compose up``` - -set time zone(optional) - Set same timezone in both nodejs server and mysql server. Something - similar to below can be used: - ``` SET GLOBAL time_zone = '+00:00'; ``` - - -The server would be accessible at ```ip_address:3000``` diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/app.js b/utils/test/vnfcatalogue/VNF_Catalogue/app.js deleted file mode 100644 index 4b6add2be..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/app.js +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Kumar Rishabh 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 express = require('express'); -var path = require('path'); -var favicon = require('serve-favicon'); -var logger = require('morgan'); -var cookieParser = require('cookie-parser'); -var bodyParser = require('body-parser'); -var validator = require('express-validator'); - -var routes = require('./routes/index'); -var search_projects = require('./routes/search_projects'); -var project_profile = require('./routes/project_profile'); -var add_project = require('./routes/add_project'); -var add_tag = require('./routes/add_tag'); -var search_tag = require('./routes/search_tag'); -var search_vnf = require('./routes/search_vnf'); -var vnf_tag_association = require('./routes/vnf_tag_association'); - - -var app = express(); - -// view engine setup -app.set('views', path.join(__dirname, 'views')); -app.set('view engine', 'jade'); - -db_pool = require('./database').pool; - -// Database -//var db = require('mysql2'); - -// uncomment after placing your favicon in /public -//app.use(favicon(__dirname + '/public/favicon.ico')); -app.use(logger('dev')); -app.use(bodyParser.json()); -app.use(bodyParser.urlencoded({ extended: false })); -app.use(validator()); -app.use(cookieParser()); -app.use(express.static(path.join(__dirname, 'public'))); - -// Make our db accessible to our router -app.use(function(req,res,next){ - //db_pool size 50 default - req.db_pool = db_pool; - next(); -}); - -app.use('/', routes); -app.use('/search_projects', search_projects); -app.use('/project_profile', project_profile); -app.use('/add_project', add_project); -app.use('/add_tag', add_tag); -app.use('/search_tag', search_tag); -app.use('/search_vnf', search_vnf); -app.use('/vnf_tag_association', vnf_tag_association); -// Some Error handling for now #TODO Remove - -/// catch 404 and forwarding to error handler -app.use(function(req, res, next) { - var err = new Error('Not Found'); - err.status = 404; - next(err); -}); - - -// development error handler -// will print stacktrace -if (app.get('env') === 'development') { - app.use(function(err, req, res, next) { - res.status(err.status || 500); - res.render('error', { - message: err.message, - error: err - }); - }); -} - -// production error handler -// no stacktraces leaked to user -app.use(function(err, req, res, next) { - res.status(err.status || 500); - res.render('error', { - message: err.message, - error: {} - }); -}); - -module.exports = app; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/bin/www b/utils/test/vnfcatalogue/VNF_Catalogue/bin/www deleted file mode 100644 index 3cfbf7796..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/bin/www +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env node -var debug = require('debug')('my-application'); -var app = require('../app'); - -app.set('port', process.env.PORT || 3000); - -var server = app.listen(app.get('port'), function() { - debug('Express server listening on port ' + server.address().port); -}); diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/database.js b/utils/test/vnfcatalogue/VNF_Catalogue/database.js deleted file mode 100644 index 4fa8be10c..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/database.js +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Kumar Rishabh 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 mysql = require('mysql'); - -var pool = mysql.createPool({ - host: process.env.DB_HOST, - user: process.env.DB_USER, - password: process.env.DB_PASSWORD, - database: process.env.DB_DATABASE, - connectionLimit: 50, - supportBigNumbers: true, - multipleStatements: true, - dateStrings: 'date' -}); - -exports.pool = pool; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/docker-compose.yml b/utils/test/vnfcatalogue/VNF_Catalogue/docker-compose.yml deleted file mode 100644 index a0ddfa480..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/docker-compose.yml +++ /dev/null @@ -1,49 +0,0 @@ -################################################################## -# Docker-Compose for setting up and running vnf_catalogue webapp -################################################################## -# Purpose: To setup and run vnf_catalogue webapp -# Usage: docker-compose up -# -# The webapp would be accessible at ip_address:3000 -# -# Maintained by Kumar Rishabh :: penguinRaider -## -# 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 -# - -version: "2" -services: - mysql: - # mysql service built on top of vanilla mysql container. - # Defines mysql credentials. - - image: mysql - container_name: vnf_catalogue_database - environment: - - MYSQL_USER=vnf_user - - MYSQL_PASSWORD=vnf_password - - MYSQL_DATABASE=vnf_catalogue - - MYSQL_ROOT_PASSWORD=root - vnf_catalogue: - # The vnf_catalogue webapp service. - build: . - container_name: vnf_catalogue_webapp - depends_on: - - mysql - # Port on which the node.js server would be exposed - # To change host port to say 80 use 80:3000 - - ports: - - "3000:3000" - vnf_catalogue_migrate: - # We define another service for database migration. This service will - # migrate the database schema.(Dockerfile resides in migration - # directory). - - build: ./migration - container_name: vnf_catalogue_migrate - depends_on: - - mysql diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/docker_commands.sh b/utils/test/vnfcatalogue/VNF_Catalogue/docker_commands.sh deleted file mode 100644 index 3be98ce8b..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/docker_commands.sh +++ /dev/null @@ -1,2 +0,0 @@ -sh ./3rd_party/wait-for-it/wait-for-it.sh mysql:3306 -t 0 -node migrate diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/LICENSE b/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/LICENSE deleted file mode 100644 index bd18d0c45..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2016 Giles Hall - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/README.md b/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/README.md deleted file mode 100644 index 900b75735..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# HELP NEEDED - -### March 13, 2017 update - -Since I posted this request for help, I've had a dozen or so responses which I am now sorting through. Applicants need to fill out [this](https://goo.gl/forms/GKCBFxaloaU47aky1) survey by March 17th. I will select, notify and announce the new volunteer(s) on March 19th. Once this is done, me and my team will work through the backlog of issues amd pull requests. Thanks for your paitence. - -### Old request follows: - -Hi there! I wrote `wait-for-it` in order to help me orchestrate containers I operate at my day job. I thought it was a neat little script, so I published it. I assumed I would be its only user, but that's not what happened! `wait-for-it` has received more stars then all of my other public repositories put together. I had no idea this tool would solicit such an audience, and I was equally unprepared to carve out the time required to address my user's issues and patches. I would like to solicit a volunteer from the community who would be willing to be a co-maintainer of this repository. If this is something you might be interested in, please email me at `waitforit@polymerase.org`. Thanks! - -## wait-for-it - -`wait-for-it.sh` is a pure bash script that will wait on the availability of a host and TCP port. It is useful for synchronizing the spin-up of interdependent services, such as linked docker containers. Since it is a pure bash script, it does not have any external dependencies. - -## Usage - -``` -wait-for-it.sh host:port [-s] [-t timeout] [-- command args] --h HOST | --host=HOST Host or IP under test --p PORT | --port=PORT TCP port under test - Alternatively, you specify the host and port as host:port --s | --strict Only execute subcommand if the test succeeds --q | --quiet Don't output any status messages --t TIMEOUT | --timeout=TIMEOUT - Timeout in seconds, zero for no timeout --- COMMAND ARGS Execute command with args after the test finishes -``` - -## Examples - -For example, let's test to see if we can access port 80 on www.google.com, and if it is available, echo the message `google is up`. - -``` -$ ./wait-for-it.sh www.google.com:80 -- echo "google is up" -wait-for-it.sh: waiting 15 seconds for www.google.com:80 -wait-for-it.sh: www.google.com:80 is available after 0 seconds -google is up -``` - -You can set your own timeout with the `-t` or `--timeout=` option. Setting the timeout value to 0 will disable the timeout: - -``` -$ ./wait-for-it.sh -t 0 www.google.com:80 -- echo "google is up" -wait-for-it.sh: waiting for www.google.com:80 without a timeout -wait-for-it.sh: www.google.com:80 is available after 0 seconds -google is up -``` - -The subcommand will be executed regardless if the service is up or not. If you wish to execute the subcommand only if the service is up, add the `--strict` argument. In this example, we will test port 81 on www.google.com which will fail: - -``` -$ ./wait-for-it.sh www.google.com:81 --timeout=1 --strict -- echo "google is up" -wait-for-it.sh: waiting 1 seconds for www.google.com:81 -wait-for-it.sh: timeout occurred after waiting 1 seconds for www.google.com:81 -wait-for-it.sh: strict mode, refusing to execute subprocess -``` - -If you don't want to execute a subcommand, leave off the `--` argument. This way, you can test the exit condition of `wait-for-it.sh` in your own scripts, and determine how to proceed: - -``` -$ ./wait-for-it.sh www.google.com:80 -wait-for-it.sh: waiting 15 seconds for www.google.com:80 -wait-for-it.sh: www.google.com:80 is available after 0 seconds -$ echo $? -0 -$ ./wait-for-it.sh www.google.com:81 -wait-for-it.sh: waiting 15 seconds for www.google.com:81 -wait-for-it.sh: timeout occurred after waiting 15 seconds for www.google.com:81 -$ echo $? -124 -``` - -## Thanks - -I wrote this script for my employer, [Ginkgo Bioworks](http://www.ginkgobioworks.com/), who was kind enough to let me release it as an open source tool. We are always looking to [hire](https://jobs.lever.co/ginkgobioworks) talented folks who are interested in working in the field of synthetic biology. diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/wait-for-it.sh b/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/wait-for-it.sh deleted file mode 100755 index eca6c3b9c..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/3rd_party/wait-for-it/wait-for-it.sh +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env bash -# Use this script to test if a given TCP host/port are available - -cmdname=$(basename $0) - -echoerr() { if [[ $QUIET -ne 1 ]]; then echo "$@" 1>&2; fi } - -usage() -{ - cat << USAGE >&2 -Usage: - $cmdname host:port [-s] [-t timeout] [-- command args] - -h HOST | --host=HOST Host or IP under test - -p PORT | --port=PORT TCP port under test - Alternatively, you specify the host and port as host:port - -s | --strict Only execute subcommand if the test succeeds - -q | --quiet Don't output any status messages - -t TIMEOUT | --timeout=TIMEOUT - Timeout in seconds, zero for no timeout - -- COMMAND ARGS Execute command with args after the test finishes -USAGE - exit 1 -} - -wait_for() -{ - if [[ $TIMEOUT -gt 0 ]]; then - echoerr "$cmdname: waiting $TIMEOUT seconds for $HOST:$PORT" - else - echoerr "$cmdname: waiting for $HOST:$PORT without a timeout" - fi - start_ts=$(date +%s) - while : - do - (echo > /dev/tcp/$HOST/$PORT) >/dev/null 2>&1 - result=$? - if [[ $result -eq 0 ]]; then - end_ts=$(date +%s) - echoerr "$cmdname: $HOST:$PORT is available after $((end_ts - start_ts)) seconds" - break - fi - sleep 1 - done - return $result -} - -wait_for_wrapper() -{ - # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692 - if [[ $QUIET -eq 1 ]]; then - timeout $TIMEOUT $0 --quiet --child --host=$HOST --port=$PORT --timeout=$TIMEOUT & - else - timeout $TIMEOUT $0 --child --host=$HOST --port=$PORT --timeout=$TIMEOUT & - fi - PID=$! - trap "kill -INT -$PID" INT - wait $PID - RESULT=$? - if [[ $RESULT -ne 0 ]]; then - echoerr "$cmdname: timeout occurred after waiting $TIMEOUT seconds for $HOST:$PORT" - fi - return $RESULT -} - -# process arguments -while [[ $# -gt 0 ]] -do - case "$1" in - *:* ) - hostport=(${1//:/ }) - HOST=${hostport[0]} - PORT=${hostport[1]} - shift 1 - ;; - --child) - CHILD=1 - shift 1 - ;; - -q | --quiet) - QUIET=1 - shift 1 - ;; - -s | --strict) - STRICT=1 - shift 1 - ;; - -h) - HOST="$2" - if [[ $HOST == "" ]]; then break; fi - shift 2 - ;; - --host=*) - HOST="${1#*=}" - shift 1 - ;; - -p) - PORT="$2" - if [[ $PORT == "" ]]; then break; fi - shift 2 - ;; - --port=*) - PORT="${1#*=}" - shift 1 - ;; - -t) - TIMEOUT="$2" - if [[ $TIMEOUT == "" ]]; then break; fi - shift 2 - ;; - --timeout=*) - TIMEOUT="${1#*=}" - shift 1 - ;; - --) - shift - CLI="$@" - break - ;; - --help) - usage - ;; - *) - echoerr "Unknown argument: $1" - usage - ;; - esac -done - -if [[ "$HOST" == "" || "$PORT" == "" ]]; then - echoerr "Error: you need to provide a host and port to test." - usage -fi - -TIMEOUT=${TIMEOUT:-15} -STRICT=${STRICT:-0} -CHILD=${CHILD:-0} -QUIET=${QUIET:-0} - -if [[ $CHILD -gt 0 ]]; then - wait_for - RESULT=$? - exit $RESULT -else - if [[ $TIMEOUT -gt 0 ]]; then - wait_for_wrapper - RESULT=$? - else - wait_for - RESULT=$? - fi -fi - -if [[ $CLI != "" ]]; then - if [[ $RESULT -ne 0 && $STRICT -eq 1 ]]; then - echoerr "$cmdname: strict mode, refusing to execute subprocess" - exit $RESULT - fi - exec $CLI -else - exit $RESULT -fi diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/migration/Dockerfile b/utils/test/vnfcatalogue/VNF_Catalogue/migration/Dockerfile deleted file mode 100644 index a04666493..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -############################################################### -# Docker container for VNF_Catalogue Schema Migration Service -############################################################### -# Purpose: Don't run it from here! Use docker-compose(See README.md) -# -# Maintained by Kumar Rishabh :: penguinRaider -## -# 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 -# - -FROM node:boron -MAINTAINER KumarRishabh::penguinRaider -LABEL version="v0.0.1" description="Open Source VNF_Catalogue for OPNFV" - -ENV DB_HOST mysql -ENV DB_USER vnf_user -ENV DB_PASSWORD vnf_password -ENV DB_DATABASE vnf_catalogue - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -COPY package.json /usr/src/app/ - -RUN npm install - -COPY . /usr/src/app - -# The ordering of events should be coming up of mysql service and then migration -# of schema for the database. To enforce this causal relationship we use a 3rd_party script. -CMD [ "./3rd_party/wait-for-it/wait-for-it.sh", "mysql:3306", "-t", "0", "--", "node", "migrate"] diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/migration/migrate.js b/utils/test/vnfcatalogue/VNF_Catalogue/migration/migrate.js deleted file mode 100644 index 3f4d892dc..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/migrate.js +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * 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 : process.env.DB_HOST, - user : process.env.DB_USER, - password : process.env.DB_PASSWORD, - database : process.env.DB_DATABASE, - 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 === 'enum' && Schema[tableName][key].hasOwnProperty('values') && Schema[tableName][key].nullable === true) { - console.log(Schema[tableName][key].values); - column = table[Schema[tableName][key].type](key, Schema[tableName][key].values).nullable(); - } - else if (Schema[tableName][key].type === 'enum' && Schema[tableName][key].hasOwnProperty('values')) { - console.log(Schema[tableName][key].values); - column = table[Schema[tableName][key].type](key, Schema[tableName][key].values).notNullable(); - } - 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/VNF_Catalogue/migration/package.json b/utils/test/vnfcatalogue/VNF_Catalogue/migration/package.json deleted file mode 100644 index 65ff32483..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "VNF_Catalogue_migration", - "version": "0.0.1", - "private": true, - "scripts": { - "start": "node ./bin/www" - }, - "dependencies": { - "bookshelf": "*", - "knex": "*", - "lodash": "*", - "mysql": "^2.13.0", - "when": "*" - } -} diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/migration/schema.js b/utils/test/vnfcatalogue/VNF_Catalogue/migration/schema.js deleted file mode 100644 index 4a7559ad0..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/migration/schema.js +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * 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}, - no_of_stars: {type: 'integer', nullable: true, unsigned: true}, - license: {type: 'enum', nullable: false, values: ['MIT', 'GPL', 'GPL_V2', 'BSD', 'APACHE']}, - opnfv_indicator: {type: 'enum', nullable: false, values: ['gold', 'silver', 'platinum']}, - complexity: {type: 'enum', nullable: true, values: ['low', 'medium', 'high']}, - activity: {type: 'enum', nullable: true, values: ['low', 'medium', 'high']}, - last_updated: {type: 'dateTime', nullable: true}, - }, - tag: { - tag_id: {type: 'increments', nullable: false, primary: true}, - tag_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; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/package.json b/utils/test/vnfcatalogue/VNF_Catalogue/package.json deleted file mode 100644 index b7a6c2385..000000000 --- a/utils/test/vnfcatalogue/VNF_Catalogue/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "VNF_Catalogue", - "version": "0.0.1", - "private": true, - "scripts": { - "start": "node ./bin/www" - }, - "dependencies": { - "body-parser": "~1.15.1", - "cookie-parser": "~1.4.3", - "debug": "~2.2.0", - "express": "~4.13.4", - "jade": "~1.11.0", - "morgan": "~1.7.0", - "serve-favicon": "~2.3.0", - "mysql": "*", - "express-validator": "*", - "nodemon": "*", - "async": "*", - "multer": "*", - "octonode": "*", - "bookshelf": "*", - "knex": "*", - "when": "*", - "lodash": "*" - } -} diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/.DS_Store b/utils/test/vnfcatalogue/VNF_Catalogue/public/3rd_party/materialize/.DS_Store deleted file mode 100644 index 2828ef6805cb5f928eff7b6775a232389a9d7006..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK&1%~~5T5l9rlru!UIRY3xWPRtj(aQ^9BfJ)Tq#oV79$x;jtRz~a~>o8 zeT5!N`VxJTUOTh94h~Llr35px%zUHSofZ3`-PHhqXwSnJ04@MHsDz~|nmdI0Nw=h6 zBSl0(bEMN?k_7nlJD6^b<^VIm4BR&cXzv!`3{psg#peEhfOgT9IuBX{p8i8Eit(QG4iI8bqz zEZWID4%1=J%r{VBHXgZ8y0hpUQ@ef~^;N0@HBs4xQ=v9;pDvfp=0RP)T-D{W)oRq` zt5$Qha=$yy^ZkRvH*cq_%d3x{K7aZ8?Z>rYU*KV-<*~&z{6wb=?;(L0GA0Co2r0k^ zrovFM{!VrT?KW^~JF*^L1~b46{5uBde2}Pwp2ggtK046o5&*G;VJ+xWEkQZbqGvHT zh&?F6q#~MBVM`2Q(lIXWIL~5k(4>Q~#fPwO7PdkW`t3Ns)Wbn|2H7$L%)o61=-(g3 zrThQ&-|K%phz&Eq4D2QYqSWbi+PF4*w{ESH?plfZ4wZz)