You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2014/01/17 12:54:47 UTC
[1/2] git commit: calling artifact update extention after a
modification happening from a pull
Updated Branches:
refs/heads/master 307a86886 -> 0635e3bc5
calling artifact update extention after a modification happening from a pull
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/093b2117
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/093b2117
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/093b2117
Branch: refs/heads/master
Commit: 093b2117f979c78397868cd0297a9c0d048cb450
Parents: daa06a0
Author: Isuru <is...@wso2.com>
Authored: Fri Jan 17 17:24:19 2014 +0530
Committer: Isuru <is...@wso2.com>
Committed: Fri Jan 17 17:24:19 2014 +0530
----------------------------------------------------------------------
.../git/impl/GitBasedArtifactRepository.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/093b2117/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
index e8fe5c6..3500b02 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
@@ -26,6 +26,7 @@ import org.apache.stratos.cartridge.agent.artifact.deployment.synchronizer.git.i
import org.apache.stratos.cartridge.agent.artifact.deployment.synchronizer.git.internal.GitDeploymentSynchronizerConstants;
import org.apache.stratos.cartridge.agent.artifact.deployment.synchronizer.git.internal.RepositoryContext;
import org.apache.stratos.cartridge.agent.artifact.deployment.synchronizer.git.util.Utilities;
+import org.apache.stratos.cartridge.agent.util.ExtensionUtils;
import org.eclipse.jgit.api.*;
import org.eclipse.jgit.api.errors.*;
import org.eclipse.jgit.lib.Ref;
@@ -519,7 +520,17 @@ public class GitBasedArtifactRepository {
}
try {
- pullCmd.call();
+ PullResult pullResult = pullCmd.call();
+ // check if we have received any updates
+ if (!pullResult.getFetchResult().getTrackingRefUpdates().isEmpty()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Artifacts were updated as a result of the pull operation, thread: " + Thread.currentThread().getName() + " - " +
+ Thread.currentThread().getId());
+ }
+
+ // execute artifact update extension
+ ExtensionUtils.executeArtifactsUpdatedExtension();
+ }
} catch (InvalidConfigurationException e) {
log.warn("Git pull unsuccessful for tenant " + gitRepoCtx.getTenantId() + ", " + e.getMessage());
@@ -527,6 +538,8 @@ public class GitBasedArtifactRepository {
//return false;
Utilities.deleteFolderStructure(new File(gitRepoCtx.getGitLocalRepoPath()));
cloneRepository(gitRepoCtx);
+ // execute artifact update extension
+ ExtensionUtils.executeArtifactsUpdatedExtension();
return true;
} catch (JGitInternalException e) {
@@ -542,6 +555,8 @@ public class GitBasedArtifactRepository {
log.warn("Git pull for the path " + e.getConflictingPaths().toString() + " failed due to conflicts");
Utilities.deleteFolderStructure(new File(gitRepoCtx.getGitLocalRepoPath()));
cloneRepository(gitRepoCtx);
+ // execute artifact update extension
+ ExtensionUtils.executeArtifactsUpdatedExtension();
return true;
} catch (GitAPIException e) {
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-stratos
Posted by is...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/0635e3bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/0635e3bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/0635e3bc
Branch: refs/heads/master
Commit: 0635e3bc5823b1d5c7f153685c9c66ee089e366b
Parents: 093b211 307a868
Author: Isuru <is...@wso2.com>
Authored: Fri Jan 17 17:24:32 2014 +0530
Committer: Isuru <is...@wso2.com>
Committed: Fri Jan 17 17:24:32 2014 +0530
----------------------------------------------------------------------
.../modules/distribution/src/main/extensions/clean.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------