No, there's no way, as far as I know. I remember that this question (or a very similar one) has come up before. I think what's making this hard to do is the fact that the information shown in the build cause popup of the "IntegrationTest" pipeline is lost. I mean, if you click on "Changes" in that pipeline, it'll show you, in yellow, which upstream pipeline(s) caused it ("IntegrationTest" pipeline) to trigger. But, once that pipeline has finished, that information is no longer accessible to the downstream pipelines (DeploymentService1, ...).
I'm wondering: If GoCD provided an environment variable (say, "GO_material_name_CHANGED" like "GO_material_name_LABEL" etc), then a deployment descriptor (a file describing what happened) can be created and pushed down as an artifact to all three downstream pipelines, which can figure out whether to re-deploy or not.
I know it's not a pipeline modeling solution but it is a solution which can enable this kind of a workflow to be supported. Thoughts?
I'm thinking of a code change like this (just to clarify):
diff --git a/common/src/com/thoughtworks/go/config/materials/PackageMaterial.java b/common/src/com/thoughtworks/go/config/materials/PackageMaterial.java
index 2513d68..3847bf2 100644
--- a/common/src/com/thoughtworks/go/config/materials/PackageMaterial.java
+++ b/common/src/com/thoughtworks/go/config/materials/PackageMaterial.java
@@ -168,6 +168,7 @@ public class PackageMaterial extends AbstractMaterial {
@Override
public void populateEnvironmentContext(EnvironmentVariableContext context, MaterialRevision materialRevision, File workingDir) {
context.setProperty(upperCase(format("GO_PACKAGE_%s_LABEL", escapeEnvironmentVariable(getName().toString()))), materialRevision.getRevision().getRevision(), false);
+ context.setProperty(upperCase(format("GO_PACKAGE_%s_CHANGED", escapeEnvironmentVariable(getName().toString()))), Boolean.toString(materialRevision.isChanged()), false);
for (ConfigurationProperty configurationProperty : getPackageDefinition().getRepository().getConfiguration()) {
context.setProperty(getEnvironmentVariableKey("GO_REPO_%s_%s", configurationProperty.getConfigurationKey().getName()),
configurationProperty.getValue(), configurationProperty.isSecure());
diff --git a/common/src/com/thoughtworks/go/config/materials/PluggableSCMMaterial.java b/common/src/com/thoughtworks/go/config/materials/PluggableSCMMaterial.java
index 391bfae..1190cf9 100644
--- a/common/src/com/thoughtworks/go/config/materials/PluggableSCMMaterial.java
+++ b/common/src/com/thoughtworks/go/config/materials/PluggableSCMMaterial.java
@@ -265,6 +265,7 @@ public class PluggableSCMMaterial extends AbstractMaterial {
@Override
public void populateEnvironmentContext(EnvironmentVariableContext context, MaterialRevision materialRevision, File workingDir) {
context.setProperty(getEnvironmentVariableKey("GO_SCM_%s_%s", "LABEL"), materialRevision.getRevision().getRevision(), false);
+ context.setProperty(getEnvironmentVariableKey("GO_SCM_%s_%s", "CHANGED"), Boolean.toString(materialRevision.isChanged()), false);
for (ConfigurationProperty configurationProperty : scmConfig.getConfiguration()) {
context.setProperty(getEnvironmentVariableKey("GO_SCM_%s_%s", configurationProperty.getConfigurationKey().getName()),
configurationProperty.getValue(), configurationProperty.isSecure());
diff --git a/common/src/com/thoughtworks/go/config/materials/ScmMaterial.java b/common/src/com/thoughtworks/go/config/materials/ScmMaterial.java
index d3c86db..aa9509e 100644
--- a/common/src/com/thoughtworks/go/config/materials/ScmMaterial.java
+++ b/common/src/com/thoughtworks/go/config/materials/ScmMaterial.java
@@ -129,13 +129,14 @@ public abstract class ScmMaterial extends AbstractMaterial {
String toRevision = materialRevision.getRevision().getRevision();
String fromRevision = materialRevision.getOldestRevision().getRevision();
- setGoRevisionVariables(environmentVariableContext, fromRevision, toRevision);
+ setGoRevisionVariables(environmentVariableContext, materialRevision, fromRevision, toRevision);
}
- private void setGoRevisionVariables(EnvironmentVariableContext environmentVariableContext, String fromRevision, String toRevision) {
+ private void setGoRevisionVariables(EnvironmentVariableContext environmentVariableContext, MaterialRevision materialRevision, String fromRevision, String toRevision) {
setVariableWithName(environmentVariableContext, toRevision, GO_REVISION);
setVariableWithName(environmentVariableContext, toRevision, GO_TO_REVISION);
setVariableWithName(environmentVariableContext, fromRevision, GO_FROM_REVISION);
+ setVariableWithName(environmentVariableContext, Boolean.toString(materialRevision.isChanged()), "GO_CHANGED");
}
protected void setVariableWithName(EnvironmentVariableContext environmentVariableContext, String value, String propertyName) {
diff --git a/common/src/com/thoughtworks/go/config/materials/dependency/DependencyMaterial.java b/common/src/com/thoughtworks/go/config/materials/dependency/DependencyMaterial.java
index 016e049..ea3681a 100644
--- a/common/src/com/thoughtworks/go/config/materials/dependency/DependencyMaterial.java
+++ b/common/src/com/thoughtworks/go/config/materials/dependency/DependencyMaterial.java
@@ -160,6 +160,7 @@ public class DependencyMaterial extends AbstractMaterial {
DependencyMaterialRevision revision = (DependencyMaterialRevision) materialRevision.getRevision();
context.setPropertyWithEscape(format("GO_DEPENDENCY_LABEL_%s", getName()), revision.getPipelineLabel());
context.setPropertyWithEscape(format("GO_DEPENDENCY_LOCATOR_%s", getName()), revision.getRevision());
+ context.setPropertyWithEscape(format("GO_DEPENDENCY_CHANGED_%s", getName()), Boolean.toString(materialRevision.isChanged()));
}
public boolean isAutoUpdate() {