ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-843 Fixed docker.
Date Wed, 10 Feb 2016 08:17:33 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 a40500940 -> f983f4210


IGNITE-843 Fixed docker.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f983f421
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f983f421
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f983f421

Branch: refs/heads/ignite-843-rc2
Commit: f983f4210ac638ec2debdc76410ab6a67d268a82
Parents: a405009
Author: Andrey <anovikov@gridgain.com>
Authored: Wed Feb 10 15:17:31 2016 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Wed Feb 10 15:17:31 2016 +0700

----------------------------------------------------------------------
 .../configuration/summary/summary.controller.js |  2 ++
 .../js/helpers/generator/generator-docker.js    | 34 +++++++++++---------
 .../main/js/helpers/generator/generator-pom.js  | 21 +++++++++++-
 3 files changed, 40 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f983f421/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
index b53bf0c..46d9f0d 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js
@@ -119,6 +119,7 @@ export default [
                         }
                     ]
                 },
+                { type: 'file', name: '.dockerignore' },
                 { type: 'file', name: 'Dockerfile' },
                 { type: 'file', name: 'pom.xml' },
                 { type: 'file', name: 'README.txt' }
@@ -229,6 +230,7 @@ export default [
             const zip = new JSZip();
 
             zip.file('Dockerfile', ctrl.data.docker);
+            zip.file('.dockerignore', $generatorDocker.ignoreFile());
 
             const builder = $generatorProperties.generateProperties(cluster);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f983f421/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
index fff6453..c45b25b 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
@@ -24,17 +24,6 @@ $generatorDocker.from = function(cluster, version) {
         'FROM apacheignite/ignite:' + version
 };
 
-// Generate secret properties if needed.
-$generatorDocker.secret = function(cluster) {
-    if ($generatorCommon.secretPropertiesNeeded(cluster))
-        return '# Append secret.properties file to container.\n' +
-            'ADD ./src/main/resources/secret.properties $IGNITE_HOME/config/secret.properties\n\n'
+
-            '# Add secret.properties file to classpath.\n' +
-            'ENV USER_LIBS $IGNITE_HOME/config';
-
-    return '';
-};
-
 // Generate Docker file for cluster.
 $generatorDocker.clusterDocker = function (cluster, version) {
     return  $generatorDocker.from(cluster, version) + '\n\n' +
@@ -42,9 +31,22 @@ $generatorDocker.clusterDocker = function (cluster, version) {
         'ENV CONFIG_URI config/' + cluster.name + '-server.xml\n\n' +
         '# Copy ignite-http-rest from optional.\n' +
         'ENV OPTION_LIBS ignite-rest-http\n\n' +
-        '# Append config file to container.\n' +
-        'ADD ./config $IGNITE_HOME/config\n\n' +
-        '# Append jdbc drivers to container.\n' +
-        'ADD ./jdbc-drivers $IGNITE_HOME/libs/jdbc-drivers\n\n' +
-        $generatorDocker.secret(cluster) + '\n';
+        '# Update packages and install maven, cpio.\n' +
+        'RUN \\\n' +
+        '   apt-get update && \\\n' +
+        '   apt-get install -y maven cpio\n\n' +
+        '# Append project to container.\n' +
+        'ADD . ' + cluster.name + '\n\n' +
+        '# Build project in container container.\n' +
+        'RUN mvn -f ' + cluster.name + '/pom.xml clean package -DskipTests\n\n' +
+        '# Copy project jars to node classpath.\n' +
+        'RUN mkdir $IGNITE_HOME/libs/' + cluster.name + ' && \\\n' +
+        '(cd ' + cluster.name +'/target &&  find . -name "*.jar" -type f | cpio -updm
$IGNITE_HOME/libs/' + cluster.name + ') && \\\n' +
+        'cp -r ' + cluster.name + '/config/* $IGNITE_HOME/config\n'
+};
+
+
+$generatorDocker.ignoreFile = function() {
+    return 'target\n' +
+            'Dockerfile';
 };

http://git-wip-us.apache.org/repos/asf/ignite/blob/f983f421/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
index 2909b5f..7995d0a 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
@@ -84,6 +84,7 @@ $generatorPom.pom = function (cluster, igniteVersion, mvnRepositories, res)
{
     });
 
     var dependencies = [];
+    var excludeGroupIds = ['org.apache.ignite'];
 
     function addDependency(groupId, artifactId, version, jar) {
         dependencies.push({
@@ -195,7 +196,7 @@ $generatorPom.pom = function (cluster, igniteVersion, mvnRepositories,
res) {
     if (dialect.SQLServer)
         addDependency('microsoft', 'jdbc', '4.1', 'sqljdbc41.jar');
 
-    $generatorPom.dependencies(res, cluster, dependencies);
+    $generatorPom.dependencies(res, cluster, dependencies, excludeGroupIds);
 
     res.needEmptyLine = true;
 
@@ -207,6 +208,24 @@ $generatorPom.pom = function (cluster, igniteVersion, mvnRepositories,
res) {
 
     res.startBlock('<plugins>');
     res.startBlock('<plugin>');
+    $generatorPom.addProperty(res, 'artifactId', 'maven-dependency-plugin');
+    res.startBlock('<executions>');
+    res.startBlock('<execution>');
+    $generatorPom.addProperty(res, 'id', 'copy-libs');
+    $generatorPom.addProperty(res, 'phase', 'test-compile');
+    res.startBlock('<goals>');
+    $generatorPom.addProperty(res, 'goal', 'copy-dependencies');
+    res.endBlock('</goals>');
+    res.startBlock('<configuration>');
+    $generatorPom.addProperty(res, 'excludeGroupIds', excludeGroupIds.join(','));
+    $generatorPom.addProperty(res, 'outputDirectory', 'target/libs');
+    $generatorPom.addProperty(res, 'includeScope', 'runtime');
+    $generatorPom.addProperty(res, 'excludeTransitive', 'true');
+    res.endBlock('</configuration>');
+    res.endBlock('</execution>');
+    res.endBlock('</executions>');
+    res.endBlock('</plugin>');
+    res.startBlock('<plugin>');
     $generatorPom.addProperty(res, 'artifactId', 'maven-compiler-plugin');
     $generatorPom.addProperty(res, 'version', '3.1');
     res.startBlock('<configuration>');


Mime
View raw message