You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by pa...@apache.org on 2017/02/27 18:19:35 UTC

[2/2] polygene-java git commit: build: add a skipDocker property to forcibly skip all docker related work

build: add a skipDocker property to forcibly skip all docker related work


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/53e42c91
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/53e42c91
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/53e42c91

Branch: refs/heads/develop
Commit: 53e42c91cf9b1c0ba9f9bde6c3ddf3f224c9312e
Parents: c71ba98
Author: Paul Merlin <pa...@apache.org>
Authored: Mon Feb 27 19:18:23 2017 +0100
Committer: Paul Merlin <pa...@apache.org>
Committed: Mon Feb 27 19:18:23 2017 +0100

----------------------------------------------------------------------
 .../structure/internals/InternalDockerPlugin.groovy   | 14 +++++++++++++-
 manual/src/docs/tutorials/howto-build-system.txt      |  3 +++
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/53e42c91/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/internals/InternalDockerPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/internals/InternalDockerPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/internals/InternalDockerPlugin.groovy
index 2247caf..d9dfa93 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/internals/InternalDockerPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/internals/InternalDockerPlugin.groovy
@@ -74,7 +74,11 @@ class InternalDockerPlugin implements Plugin<Project>
       task.onError = { ex ->
         // Disable Docker for this build
         project.rootProject.extensions.extraProperties.set( CodePlugin.DOCKER_DISABLED_EXTRA_PROPERTY, true )
-        if( project.logger.isEnabled( LogLevel.INFO ) )
+        if( project.hasProperty( 'skipDocker' ) )
+        {
+            project.logger.lifecycle 'skipDocker property is set, all Docker tasks will be SKIPPED'
+        }
+        else if( project.logger.isEnabled( LogLevel.INFO ) )
         {
           project.logger.info 'Unable to connect to Docker, all Docker tasks will be SKIPPED', ex
         }
@@ -83,6 +87,14 @@ class InternalDockerPlugin implements Plugin<Project>
           project.logger.lifecycle "Unable to connect to Docker, all Docker tasks will be SKIPPED\n  ${ ( ( Exception ) ex ).message }"
         }
       }
+      task.onComplete = {
+        if( project.hasProperty( 'skipDocker' ) )
+        {
+          // Disable Docker for this build
+          project.rootProject.extensions.extraProperties.set( CodePlugin.DOCKER_DISABLED_EXTRA_PROPERTY, true )
+          project.logger.lifecycle 'skipDocker property is set, all Docker tasks will be SKIPPED'
+        }
+      }
     } as Action<DockerVersion> )
   }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/53e42c91/manual/src/docs/tutorials/howto-build-system.txt
----------------------------------------------------------------------
diff --git a/manual/src/docs/tutorials/howto-build-system.txt b/manual/src/docs/tutorials/howto-build-system.txt
index 0aa7b38..86460f0 100644
--- a/manual/src/docs/tutorials/howto-build-system.txt
+++ b/manual/src/docs/tutorials/howto-build-system.txt
@@ -180,6 +180,9 @@ The last stanza set environment variables for Docker to use the newly created Do
 If you want to run the Docker containers in a remote machine, simply set the `DOCKER_HOST` and `DOCKER_CERT_PATH`
 environment variables to something sensible for your setup.
 
+If you want to forcibly skip all Docker related work, set the `skipDocker` Gradle property by e.g. appending
+`-PskipDocker` to your Gradle command line.
+
 === Performance tests ===
 
 Performance tests provide performance measurements for typical Polygene\u2122 use cases.