diff --git a/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/java/uk/xlab/teamcity/phabricator/PhabricatorBuildStartContextProcessor.java b/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/java/uk/xlab/teamcity/phabricator/PhabricatorBuildStartContextProcessor.java new file mode 100644 index 0000000..f70731f --- /dev/null +++ b/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/java/uk/xlab/teamcity/phabricator/PhabricatorBuildStartContextProcessor.java @@ -0,0 +1,22 @@ +package uk.xlab.teamcity.phabricator; + +import java.util.Map; + +import jetbrains.buildServer.serverSide.BuildStartContext; +import jetbrains.buildServer.serverSide.BuildStartContextProcessor; + +public class PhabricatorBuildStartContextProcessor implements BuildStartContextProcessor { + + @Override + public void updateParameters(BuildStartContext context) { + // Get build parameters and put them in a shared location for access on the + // agent + Map parameters = context.getBuild().getBuildOwnParameters(); + + context.addSharedParameter(Constants.BRANCH_NAME, parameters.get(Constants.BRANCH_NAME)); + context.addSharedParameter(Constants.BUILD_ID, parameters.get(Constants.BUILD_ID)); + context.addSharedParameter(Constants.DIFF_ID, parameters.get(Constants.DIFF_ID)); + context.addSharedParameter(Constants.HARBORMASTER_PHID, parameters.get(Constants.HARBORMASTER_PHID)); + context.addSharedParameter(Constants.REVISION_ID, parameters.get(Constants.REVISION_ID)); + } +} diff --git a/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/resources/META-INF/build-server-plugin-phabricator-plugin.xml b/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/resources/META-INF/build-server-plugin-phabricator-plugin.xml index a6345e4..037ccd7 100644 --- a/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/resources/META-INF/build-server-plugin-phabricator-plugin.xml +++ b/Teamcity-Phabricator-Plugin/phabricator-plugin-server/src/main/resources/META-INF/build-server-plugin-phabricator-plugin.xml @@ -3,8 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" default-autowire="constructor"> - + +