Browse Source

AMBARI-6719. Package Jobs View as a jar. (yusaku)

Yusaku Sako 10 years ago
parent
commit
2c8925345b

+ 171 - 0
contrib/views/jobs/pom.xml

@@ -0,0 +1,171 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<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">
+    <parent>
+        <groupId>org.apache.ambari.views</groupId>
+        <artifactId>ambari-contrib-views</artifactId>
+        <version>0.1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.ambari</groupId>
+    <artifactId>jobs</artifactId>
+    <packaging>jar</packaging>
+    <name>Jobs</name>
+    <version>1.3.0-SNAPSHOT</version>
+    <description>Jobs View</description>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <id>parse-version</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>parse-version</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>regex-property</id>
+                        <goals>
+                            <goal>regex-property</goal>
+                        </goals>
+                        <configuration>
+                            <name>ambariVersion</name>
+                            <value>${project.version}</value>
+                            <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
+                            <replacement>$1.$2.$3</replacement>
+                            <failIfNoMatch>false</failIfNoMatch>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.github.eirslett</groupId>
+                <artifactId>frontend-maven-plugin</artifactId>
+                <version>0.0.14</version>
+                <configuration>
+                    <nodeVersion>v0.10.26</nodeVersion>
+                    <npmVersion>1.4.3</npmVersion>
+                    <workingDirectory>src/main/resources/ui</workingDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>install node and npm</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>install-node-and-npm</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>npm install</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+                        <configuration>
+                            <arguments>install --unsafe-perm</arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>exec-maven-plugin</artifactId>
+                <groupId>org.codehaus.mojo</groupId>
+                <executions>
+                    <execution>
+                        <id>Bower install</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                            <workingDirectory>${basedir}/src/main/resources/ui</workingDirectory>
+                            <executable>node/node</executable>
+                            <arguments>
+                                <argument>node_modules/bower/bin/bower</argument>
+                                <argument>install</argument>
+                                <argument>--allow-root</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>grunt build</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                            <workingDirectory>${basedir}/src/main/resources/ui</workingDirectory>
+                            <executable>node/node</executable>
+                            <arguments>
+                                <argument>node_modules/.bin/grunt</argument>
+                                <argument>build</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.0</version>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptors>
+                        <descriptor>src/main/assemblies/empty.xml</descriptor>
+                    </descriptors>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.vafer</groupId>
+                <artifactId>jdeb</artifactId>
+                <version>1.0.1</version>
+                <executions>
+                    <execution>
+                        <phase>none</phase>
+                        <goals>
+                            <goal>jdeb</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <skip>true</skip>
+                    <submodules>false</submodules>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <includes>
+                    <include>META-INF/**/*</include>
+                    <include>view.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources/ui/dist</directory>
+                <filtering>false</filtering>
+            </resource>
+        </resources>
+    </build>
+</project>

+ 17 - 0
contrib/views/jobs/src/main/resources/ui/Gruntfile.js

@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 // Generated on 2014-06-24 using generator-ember 0.8.4
 // Generated on 2014-06-24 using generator-ember 0.8.4
 'use strict';
 'use strict';
 var LIVERELOAD_PORT = 35729;
 var LIVERELOAD_PORT = 35729;

+ 2 - 2
contrib/views/jobs/src/main/resources/ui/app/scripts/helpers/ajax.js

@@ -133,14 +133,14 @@ var formatRequest = function (data) {
     type: this.type || 'GET',
     type: this.type || 'GET',
     dataType: 'json',
     dataType: 'json',
     async: true,
     async: true,
-    headers: this.headers || {Accept: "application/json; charset=utf-8"}
+    headers: this.headers
   };
   };
   if (App.get('testMode')) {
   if (App.get('testMode')) {
     opt.url = formatUrl(this.mock ? this.mock : '', data);
     opt.url = formatUrl(this.mock ? this.mock : '', data);
     opt.type = 'GET';
     opt.type = 'GET';
   }
   }
   else {
   else {
-    var prefix = App.get('urlPrefix');
+    var prefix = this.apiPrefix != null ? this.apiPrefix : App.get('urlPrefix');
     opt.url = prefix + formatUrl(this.real, data);
     opt.url = prefix + formatUrl(this.real, data);
   }
   }
 
 

+ 2 - 0
contrib/views/jobs/src/main/resources/ui/package.json

@@ -3,7 +3,9 @@
   "version": "0.0.1",
   "version": "0.0.1",
   "dependencies": {},
   "dependencies": {},
   "devDependencies": {
   "devDependencies": {
+    "bower": "1.3.8",
     "grunt": "~0.4.1",
     "grunt": "~0.4.1",
+    "grunt-cli": "~0.1.13",
     "grunt-contrib-copy": "~0.4.1",
     "grunt-contrib-copy": "~0.4.1",
     "grunt-contrib-concat": "~0.3.0",
     "grunt-contrib-concat": "~0.3.0",
     "grunt-contrib-uglify": "~0.2.0",
     "grunt-contrib-uglify": "~0.2.0",

+ 17 - 0
contrib/views/jobs/src/main/resources/ui/test/index.html

@@ -1,3 +1,20 @@
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
 <!doctype html>
 <!doctype html>
 <html>
 <html>
   <head>
   <head>

+ 24 - 0
contrib/views/jobs/src/main/resources/view.xml

@@ -0,0 +1,24 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. Kerberos, LDAP, Custom. Binary/Htt
+-->
+<view>
+  <name>JOBS</name>
+  <label>Jobs View</label>
+  <version>1.0.0</version>
+  <instance>
+    <name>JOBS_1</name>
+  </instance>
+</view>

+ 1 - 0
contrib/views/pom.xml

@@ -27,6 +27,7 @@
   </properties>
   </properties>
   <modules>
   <modules>
     <module>files</module>
     <module>files</module>
+    <module>jobs</module>
     <module>pig</module>
     <module>pig</module>
     <module>slider</module>
     <module>slider</module>
     <module>capacity-scheduler</module>
     <module>capacity-scheduler</module>

+ 12 - 6
pom.xml

@@ -182,7 +182,9 @@
             <exclude>**/.gitignore</exclude>
             <exclude>**/.gitignore</exclude>
             <exclude>**/.gitattributes</exclude>
             <exclude>**/.gitattributes</exclude>
             <exclude>**/.gitkeep</exclude>
             <exclude>**/.gitkeep</exclude>
-            <!--gitignore content-->
+            <exclude>**/.jshintrc</exclude>
+            <exclude>**/.editorconfig</exclude>
+              <!--gitignore content-->
             <exclude>.DS_Store</exclude>
             <exclude>.DS_Store</exclude>
             <exclude>.iml/</exclude>
             <exclude>.iml/</exclude>
             <exclude>.classpath</exclude>
             <exclude>.classpath</exclude>
@@ -203,11 +205,20 @@
             <exclude>contrib/ambari-scom/management-pack/Hadoop_MP/**</exclude>
             <exclude>contrib/ambari-scom/management-pack/Hadoop_MP/**</exclude>
             <exclude>contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase</exclude>
             <exclude>contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase</exclude>
             <exclude>contrib/ambari-scom/msi/src/GUI_Ambari.sln</exclude>
             <exclude>contrib/ambari-scom/msi/src/GUI_Ambari.sln</exclude>
+            <exclude>contrib/ambari-scom/ambari-scom-server/pass.txt</exclude>
+            <exclude>contrib/ambari-scom/*/rat.txt</exclude>
+            <exclude>contrib/ambari-scom/metrics-sink/target/**</exclude>
             <exclude>contrib/views/*/target/**</exclude>
             <exclude>contrib/views/*/target/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/bower_components/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/bower_components/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/node/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/node/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/node_modules/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/node_modules/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/public/**</exclude>
             <exclude>contrib/views/files/src/main/resources/ui/public/**</exclude>
+            <exclude>contrib/views/jobs/src/main/resources/ui/.tmp/**</exclude>
+            <exclude>contrib/views/jobs/src/main/resources/ui/**/bower_components/**</exclude>
+            <exclude>contrib/views/jobs/src/main/resources/ui/dist/**</exclude>
+            <exclude>contrib/views/jobs/src/main/resources/ui/node/**</exclude>
+            <exclude>contrib/views/jobs/src/main/resources/ui/node_modules/**</exclude>
+            <exclude>contrib/views/jobs/src/main/resources/ui/**/.bowerrc</exclude>
             <exclude>contrib/views/pig/src/main/resources/ui/pig-web/public/**</exclude>
             <exclude>contrib/views/pig/src/main/resources/ui/pig-web/public/**</exclude>
             <exclude>contrib/views/pig/src/main/resources/ui/pig-web/node_modules/**</exclude>
             <exclude>contrib/views/pig/src/main/resources/ui/pig-web/node_modules/**</exclude>
             <exclude>contrib/views/pig/src/main/resources/ui/pig-web/node/**</exclude>
             <exclude>contrib/views/pig/src/main/resources/ui/pig-web/node/**</exclude>
@@ -222,11 +233,6 @@
             <exclude>contrib/views/*/.classpath</exclude>
             <exclude>contrib/views/*/.classpath</exclude>
             <exclude>contrib/views/*/.project</exclude>
             <exclude>contrib/views/*/.project</exclude>
             <exclude>contrib/views/*/.settings/**</exclude>
             <exclude>contrib/views/*/.settings/**</exclude>
-            <exclude>contrib/views/jobs/src/main/resources/ui/**</exclude>
-            
-            <exclude>contrib/ambari-scom/ambari-scom-server/pass.txt</exclude>
-            <exclude>contrib/ambari-scom/*/rat.txt</exclude>
-            <exclude>contrib/ambari-scom/metrics-sink/target/**</exclude>
 
 
             <!--Velocity log -->
             <!--Velocity log -->
             <exclude>**/velocity.log*</exclude>
             <exclude>**/velocity.log*</exclude>