usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rockers...@apache.org
Subject [1/7] incubator-usergrid git commit: USERGRID-248 Create a package for portal distributions that can be uploaded via nexus.
Date Fri, 12 Dec 2014 00:35:43 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/master 3032dfaa1 -> c06f26b58


 USERGRID-248 Create a package for portal distributions that can be uploaded via nexus.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3c06eb15
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3c06eb15
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3c06eb15

Branch: refs/heads/master
Commit: 3c06eb15f8c9bf5190a8be12f0daa5aba035501f
Parents: 7131c5a
Author: John D. Ament <johndament@apache.org>
Authored: Wed Nov 12 21:56:54 2014 -0500
Committer: John D. Ament <johndament@apache.org>
Committed: Wed Nov 12 21:56:54 2014 -0500

----------------------------------------------------------------------
 .gitignore          |   5 +-
 portal/Gruntfile.js | 204 +++++++++++++++++++++++++++++++----------------
 portal/README.md    |   5 ++
 portal/build.sh     |   1 +
 portal/package.json |   2 +-
 portal/pom.xml      |  81 +++++++++++++++++++
 6 files changed, 225 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c06eb15/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 47ed041..123fac4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@ Icon
 /stack/corepersistence/priamcluster/aws.properties
 #Webstorm artifacts
 .idea/
+*.iml
 stack/corepersistence/collection/nbactions.xml
 stack/corepersistence/graph/nbactions.xml
 stack/corepersistence/model/nbactions.xml
@@ -40,7 +41,7 @@ stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/q
 /portal/js/templates.js
 /portal/index.html
 /portal/index-debug.html
-
+/portal/dist/*
 /portal/dist/usergrid-portal/
 /portal/dist/appsvc-ui/
 /portal/nbproject/project.properties
@@ -60,4 +61,4 @@ portal/js/templates.js
 
 /portal/seleniumLog.txt
 /stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterLexer.java
-/stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java
\ No newline at end of file
+/stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c06eb15/portal/Gruntfile.js
----------------------------------------------------------------------
diff --git a/portal/Gruntfile.js b/portal/Gruntfile.js
index f768b61..5ebba14 100644
--- a/portal/Gruntfile.js
+++ b/portal/Gruntfile.js
@@ -18,8 +18,8 @@
 */
 var bower = require('./bower.json');
 
-var distPath = 'dist/'+bower.name,
-  coveragePath = 'dist-cov/'+bower.name,
+var distPath = 'dist/' + bower.name,
+  coveragePath = 'dist-cov/' + bower.name,
   libsFile = 'js/generated/usergrid-libs.min.js',
   devFile = 'js/generated/usergrid-dev.js',
   mainFile = 'js/generated/usergrid.min.js',
@@ -28,7 +28,8 @@ var distPath = 'dist/'+bower.name,
   coverageFile = 'test/coverage/instrument/js/usergrid-coverage.min.js',
 
   distName = bower.name,
-  licenseHeader =' /**\n \
+  licenseHeader =
+  ' /**\n \
  Licensed to the Apache Software Foundation (ASF) under one\n \
  or more contributor license agreements.  See the NOTICE file\n \
  distributed with this work for additional information \n \
@@ -46,8 +47,10 @@ var distPath = 'dist/'+bower.name,
  specific language governing permissions and limitations\n \
  under the License.\n \
  */\n';
-console.warn('to run e2e tests you need to have a running instance of webdriver, 1) npm install
protractor -g -> 2) webdriver-manager start --standalone');
-module.exports = function (grunt) {
+console.warn(
+  'to run e2e tests you need to have a running instance of webdriver, 1) npm install protractor
-g -> 2) webdriver-manager start --standalone'
+);
+module.exports = function(grunt) {
 
 
   // Project configuration.
@@ -56,16 +59,19 @@ module.exports = function (grunt) {
 
     uglify: {
       options: {
-        banner: licenseHeader + '\n /*! <%= pkg.name %>@<%= pkg.version %>  */\n'
+        banner: licenseHeader +
+          '\n /*! <%= pkg.name %>@<%= pkg.version %>  */\n'
       },
-      'usergrid-libs':{
+      'usergrid-libs': {
         options: {
           mangle: false,
-          compress: {warnings:false},
+          compress: {
+            warnings: false
+          },
           beautify: false
         },
-        files:{
-          'js/generated/usergrid-libs.min.js':[
+        files: {
+          'js/generated/usergrid-libs.min.js': [
             'js/libs/jquery/jquery-1.9.1.min.js',
             'js/libs/jquery/jquery-migrate-1.1.1.min.js',
             'js/libs/jquery/jquery.sparkline.min.js',
@@ -110,20 +116,22 @@ module.exports = function (grunt) {
         },
         files: {
           'test/coverage/instrument/js/usergrid-coverage.min.js': [
-            coverageDir+'js/app.js',
-            coverageDir+'js/**/*.js',
+            coverageDir + 'js/app.js',
+            coverageDir + 'js/**/*.js',
             'js/generated-templates/templates.js',
-            '!'+coverageDir+'js/config.js',
-            '!'+coverageDir+'js/libs/**/*.js',
-            '!'+coverageDir+'js/generated/*.js',
-            '!'+coverageDir+'js/usergrid-coverage.min.js'
+            '!' + coverageDir + 'js/config.js',
+            '!' + coverageDir + 'js/libs/**/*.js',
+            '!' + coverageDir + 'js/generated/*.js',
+            '!' + coverageDir + 'js/usergrid-coverage.min.js'
           ]
         }
       },
       'usergrid-coverage-min': {
         options: {
           mangle: false,
-          compress: {warnings:false},
+          compress: {
+            warnings: false
+          },
           beautify: false
         },
         files: {
@@ -135,7 +143,9 @@ module.exports = function (grunt) {
       'usergrid': {
         options: {
           mangle: false,
-          compress: {warnings:false},
+          compress: {
+            warnings: false
+          },
           beautify: false
         },
         files: {
@@ -151,10 +161,12 @@ module.exports = function (grunt) {
         options: {
           base: 'js/'
         },
-        src: ['js/**/*.html','!**/index*'],
+        src: ['js/**/*.html', '!**/index*'],
         dest: templateFile,
-        options:  {
-          url:    function(url) { return url.replace('js/', ''); }
+        options: {
+          url: function(url) {
+            return url.replace('js/', '');
+          }
         }
       }
     },
@@ -188,8 +200,8 @@ module.exports = function (grunt) {
         options: {
           target: 'http://localhost:3000/index-debug.html', // target url to open
           open: 'http://localhost:3000/index-debug.html',
-          hostname:'*',
-          livereload:true,
+          hostname: '*',
+          livereload: true,
           port: 3000,
           base: ''
         }
@@ -239,13 +251,13 @@ module.exports = function (grunt) {
         keepAlive: true, // If false, the grunt process stops when the test fails.
         noColor: false, // If true, protractor will not use colors in its output.
         args: {
-          baseUrl:'http://localhost:3005/'
+          baseUrl: 'http://localhost:3005/'
         }
       },
       phantom: {
         options: {
           args: {
-            baseUrl:'http://localhost:3005/',
+            baseUrl: 'http://localhost:3005/',
             // Arguments passed to the command
             'browser': 'phantomjs'
           }
@@ -254,7 +266,7 @@ module.exports = function (grunt) {
       chrome: {
         options: {
           args: {
-            baseUrl:'http://localhost:3006/?noHelp=true',
+            baseUrl: 'http://localhost:3006/?noHelp=true',
             // Arguments passed to the command
             'browser': 'chrome'
           }
@@ -263,76 +275,116 @@ module.exports = function (grunt) {
       firefox: {
         options: {
           args: {
-            baseUrl:'http://localhost:3007/',
+            baseUrl: 'http://localhost:3007/',
             // Arguments passed to the command
             'browser': 'firefox'
           }
         }
       }
     },
-    copy:{
-      coverage:{
-        files:[
-          {
-            src:['js/*.min.js','js/libs/**','sdk/**','js/charts/*.json','css/**','img/**','js/libs/**','config.js','bower_components/**'],
-            dest:coveragePath,
-            expand:true
-          },
-          {
-            src:['js/*.min.js'],
-            dest:coveragePath,
-            cwd: coverageDir,
-            expand:true
-          }
-        ]
+    copy: {
+      coverage: {
+        files: [{
+          src: ['js/*.min.js', 'js/libs/**', 'sdk/**',
+            'js/charts/*.json', 'css/**', 'img/**', 'js/libs/**',
+            'config.js', 'bower_components/**'
+          ],
+          dest: coveragePath,
+          expand: true
+        }, {
+          src: ['js/*.min.js'],
+          dest: coveragePath,
+          cwd: coverageDir,
+          expand: true
+        }]
       },
-      main:{
-        files:[
+      main: {
+        files: [
           // includes files within path
-          {expand: true, src: ['*.html','config.js', '*.ico', 'helpJson.json'], dest: distPath,
filter: 'isFile'},
-          {expand: true, src: ['sdk/**','css/**','img/**','js/charts/*.json'], dest: distPath},
-          {expand: true, src: ['js/generated/**','js/libs/**','css/**','img/**','bower_components/**'],
dest: distPath}
+          {
+            expand: true,
+            src: ['*.html', 'config.js', '*.ico', 'helpJson.json'],
+            dest: distPath,
+            filter: 'isFile'
+          }, {
+            expand: true,
+            src: ['sdk/**', 'css/**', 'img/**', 'js/charts/*.json'],
+            dest: distPath
+          }, {
+            expand: true,
+            src: ['js/generated/**', 'js/libs/**', 'css/**', 'img/**',
+              'bower_components/**'
+            ],
+            dest: distPath
+          }
 
         ]
       }
     },
     clean: {
-        build: ['dist/','dist-cov/','test/','js/generated/','js/*.min.js',templateFile,'index.html','index-debug.html'],
-        coverage: ['reports/']
+      build: ['dist/', 'dist-cov/', 'test/', 'js/generated/',
+        'js/*.min.js', templateFile, 'index.html', 'index-debug.html'
+      ],
+      coverage: ['reports/']
     },
     dom_munger: {
       main: {
         options: {
-          update: {selector:'#main-script',attribute:'src',value:mainFile}
+          update: {
+            selector: '#main-script',
+            attribute: 'src',
+            value: mainFile
+          }
 
         },
-        src: 'index-template.html',  //update the dist/index.html (the src index.html is
copied there)
-        dest: 'index.html'  //update the dist/index.html (the src index.html is copied there)
+        src: 'index-template.html', //update the dist/index.html (the src index.html is copied
there)
+        dest: 'index.html' //update the dist/index.html (the src index.html is copied there)
 
       },
       dev: {
         options: {
-          update: {selector:'#main-script',attribute:'src',value:devFile}
+          update: {
+            selector: '#main-script',
+            attribute: 'src',
+            value: devFile
+          }
         },
-        src: 'index-template.html',  //update the dist/index.html (the src index.html is
copied there)
-        dest: 'index-debug.html'  //update the dist/index.html (the src index.html is copied
there)
+        src: 'index-template.html', //update the dist/index.html (the src index.html is copied
there)
+        dest: 'index-debug.html' //update the dist/index.html (the src index.html is copied
there)
       },
       coverage: {
         options: {
-          update: {selector:'#main-script',attribute:'src',value:'js/usergrid-coverage.min.js'}
+          update: {
+            selector: '#main-script',
+            attribute: 'src',
+            value: 'js/usergrid-coverage.min.js'
+          }
         },
-        src: 'index-template.html',  //update the dist/index.html (the src index.html is
copied there)
-        dest: coveragePath+'/index.html'  //update the dist/index.html (the src index.html
is copied there)
+        src: 'index-template.html', //update the dist/index.html (the src index.html is copied
there)
+        dest: coveragePath + '/index.html' //update the dist/index.html (the src index.html
is copied there)
       }
     },
     bower: {
       install: {
-        options:{
-          cleanup:false,
-          copy:false
+        options: {
+          cleanup: false,
+          copy: false
         }
       }
     },
+    compress: {
+      main: {
+        options: {
+          mode: 'tar',
+          archive: 'dist/' + distName + '.tar'
+        },
+        expand: true,
+        cwd: distPath + '/',
+        src: ['**/*'],
+        dest: distName + '.' + bower.version
+      }
+    },
+
     instrument: {
       files: 'js/**/*.js',
       options: {
@@ -355,6 +407,7 @@ module.exports = function (grunt) {
   grunt.loadNpmTasks('grunt-contrib-copy');
   grunt.loadNpmTasks('grunt-contrib-watch');
   grunt.loadNpmTasks('grunt-contrib-connect');
+  grunt.loadNpmTasks('grunt-contrib-compress');
   grunt.loadNpmTasks('grunt-contrib-clean');
   grunt.loadNpmTasks('grunt-angular-templates');
   grunt.loadNpmTasks('grunt-bower-task');
@@ -371,17 +424,28 @@ module.exports = function (grunt) {
   grunt.registerTask('validate', ['jshint', 'complexity']);
   grunt.registerTask('report', ['build', 'coverage']);
 
-  grunt.registerTask('build', ['clean:build','bower:install','ngtemplates', 'uglify','cssmin','dom_munger','karma:unit','copy']);
-  grunt.registerTask('build-dev', [ 'build']);
-  grunt.registerTask('build-coverage', [ 'ngtemplates','instrument','uglify:usergrid-coverage','uglify:usergrid-coverage-min',
'cssmin','dom_munger', 'copy:coverage']);
+  grunt.registerTask('build', ['clean:build', 'bower:install', 'ngtemplates',
+    'uglify', 'cssmin', 'dom_munger', 'karma:unit', 'copy'
+  ]);
+  grunt.registerTask('build-dev', ['build']);
+  grunt.registerTask('build-coverage', ['ngtemplates', 'instrument',
+    'uglify:usergrid-coverage', 'uglify:usergrid-coverage-min', 'cssmin',
+    'dom_munger', 'copy:coverage'
+  ]);
 
   grunt.registerTask('default', ['build']);
 
-  grunt.registerTask('e2e', ['connect:e2e-phantom','protractor:phantom']);
-  grunt.registerTask('e2e-chrome', ['connect:e2e-chrome','protractor:chrome']);
-  grunt.registerTask('e2e-coverage', ['clean:coverage', 'connect:e2e-coverage','protractor:coverage']);
-  grunt.registerTask('e2e-coverage-chrome', ['clean:coverage', 'connect:e2e-coverage-chrome','protractor:chrome',
'makeReport']);
-  grunt.registerTask('e2e-firefox', ['connect:e2e-firefox','protractor:firefox']);
-  grunt.registerTask('no-monitoring', ['build','clean:perf','karma:unit']);
+  grunt.registerTask('e2e', ['connect:e2e-phantom', 'protractor:phantom']);
+  grunt.registerTask('e2e-chrome', ['connect:e2e-chrome', 'protractor:chrome']);
+  grunt.registerTask('e2e-coverage', ['clean:coverage',
+    'connect:e2e-coverage', 'protractor:coverage'
+  ]);
+  grunt.registerTask('e2e-coverage-chrome', ['clean:coverage',
+    'connect:e2e-coverage-chrome', 'protractor:chrome', 'makeReport'
+  ]);
+  grunt.registerTask('e2e-firefox', ['connect:e2e-firefox',
+    'protractor:firefox'
+  ]);
+  grunt.registerTask('no-monitoring', ['build', 'clean:perf', 'karma:unit']);
 
 };

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c06eb15/portal/README.md
----------------------------------------------------------------------
diff --git a/portal/README.md b/portal/README.md
index b6e7ced..5318229 100644
--- a/portal/README.md
+++ b/portal/README.md
@@ -51,6 +51,11 @@ If you want to run the e2e tests:
 
 To version open a terminal and run 'npm version x.x.x' this will add a tag and increment
the package.json.
 
+If you are building via maven:
+
+1. The maven profile supports the default install options currently, just run `mvn clean
install` to create the bundle.
+2. To override to another option, run maven via `mvn clean install -Dbuild.mode=e2e` or `mvn
clean install -Dbuild.mode=dev`.
+
 ##Using a different api location
 1. You can use api from usergrid at any location by navigating to the portal and adding a
querystring http://myurl/?api_url=http://someurl
 2. Another option is to change the Usergrid.overrideUrl in config.js

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c06eb15/portal/build.sh
----------------------------------------------------------------------
diff --git a/portal/build.sh b/portal/build.sh
index fdfb28b..88e524f 100755
--- a/portal/build.sh
+++ b/portal/build.sh
@@ -20,6 +20,7 @@ buildMain(){
   echo grunt $1
   echo #####
   ./node_modules/grunt-cli/bin/grunt $1
+  ./node_modules/grunt-cli/bin/grunt compress
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c06eb15/portal/package.json
----------------------------------------------------------------------
diff --git a/portal/package.json b/portal/package.json
index 78aba40..3829983 100644
--- a/portal/package.json
+++ b/portal/package.json
@@ -32,7 +32,7 @@
     "protractor": "~0.22.0",
     "grunt-protractor-runner": "~0.2.0",
     "grunt-contrib-copy": "~0.4.1",
-    "grunt-contrib-compress": "~0.5.3",
+    "grunt-contrib-compress": "~0.12.0",
     "grunt-contrib-clean": "~0.4.0",
     "grunt-dom-munger": "~3.1.0",
     "bower": "~1.2.8",

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c06eb15/portal/pom.xml
----------------------------------------------------------------------
diff --git a/portal/pom.xml b/portal/pom.xml
new file mode 100644
index 0000000..f21158e
--- /dev/null
+++ b/portal/pom.xml
@@ -0,0 +1,81 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>15</version>
+        <relativePath></relativePath>
+    </parent>
+
+    <groupId>org.apache.usergrid</groupId>
+    <artifactId>usergrid-portal</artifactId>
+    <version>1.0.1-SNAPSHOT</version>
+    <name>Usergrid Portal</name>
+    <description>Apache Usergrid Portal Project</description>
+    <packaging>pom</packaging>
+    <properties>
+        <build.mode>standard</build.mode>
+    </properties>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.6.1</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>dist</directory>
+                        </fileset>
+                        <fileset>
+                            <directory>dist-cov</directory>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.3.2</version>
+                <executions>
+                    <execution>
+                        <id>create-package</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <executable>build.sh</executable>
+                    <arguments>
+                        <argument>${build.mode}</argument>
+                    </arguments>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.9.1</version>
+                <executions>
+                    <execution>
+                        <id>attach-artifacts</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>dist/usergrid-portal.tar</file>
+                                    <type>tar</type>
+                                    <classifier>dist</classifier>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>


Mime
View raw message