Fork 0
Commit graph

25 commits

Author SHA1 Message Date
Steven Cooney d99cf09270 Improve README and Add Licence
Summary: Improve the README giving an overview of the project and why it was needed. Also add the MIT licence since we are going to open source the plugin and credit the orginal author the Harbormaster files we are using. Also updated the TeamCity build definition to include build number in the plugin output file.

Test Plan:
Packaged locally to verify the version number is included in the plugin zip.
Other changes were text in the README and LICENCE

Reviewers: #dev, rob.marshall

Reviewed By: #dev, rob.marshall

Subscribers: rob.marshall

Differential Revision: https://phab.xlab.uk/D2704
2019-06-21 13:11:27 +01:00
Steven Cooney 694b6413ee Remove some Logging duplication and Tidy-up
Tidied up some of the logging to the build log by adding a wrapper class to do some formatting and pulling out hard-coded prefixing. Also improved the commenting through the TeamCity plugin.
2019-06-19 15:56:29 +01:00
Steven Cooney 3564d14927 Skip Patch When Plugin Not Installed
Explicitly set `phabricatorTriggeredBuild` to false on exit points on `AgentBuildExtension` because we are seeing behaviour that suggest the default value is not used in the `sourcesUpdated` step
2019-06-05 16:38:13 +01:00
Steven Cooney 6a16a01e93 Log Successful Arc Patch
Notify the build log when a patch has been applied without issues.
2019-06-05 14:15:06 +01:00
Steven Cooney 51b9c105aa Update Plugin Name
Update the plugin name and vendor information.
2019-06-05 13:59:22 +01:00
Steven Cooney ef0656b1de Add TeamCity Agent
Add a TeamCity agent to which run after the VCS sources have been applied to trigger arcanist patch and pull in any changes from the specified Phabricator revision onto master and verify they build.
2019-06-05 13:37:40 +01:00
Steven Cooney abfa8f840d Add PathToArc Parameter on Build Feature & Moving Logging Classes
Add a new field on the build feature dialog allowing the user to specify where arcanist command is located on the agent. We will need this information to execute the patching process upon which we will be building.

This commit also add Command and CommandBuilder into Common which we will be using to execute arcanist to apply the `arc patch` during the build so we can actually build the changes from the revision,

Also moved the three logging based files into a sub-folder causing many file updates of just an import.
2019-06-05 11:54:08 +01:00
Steven Cooney cefb59b73a Remove BRANCH_NAME Parameter
In the past TeamCity allowed us to spoof the branch we ran a build configuration on. We were going to utilise this with each differential revision having its own TeamCity branch. However in a recent change (post 2018.2.2) branches specified in builds must have a corresponding VCS branch otherwise the build is marked as failed. We therefore don't need a branch name within the teamcity plugin.

We are still passing through the REVISION_BUILD to allow us to display the snapshot within TeamCity.
2019-06-05 11:22:53 +01:00
Steven Cooney 8d56fa3128 Initial Agent Plugin Setup
We have added an agent side plugin which will be used to patch in the changes from a phabricator differential. We verify all the required settings are in place and enable the patching process after the repository have been cloned. Currently arcanist has been implemented to pull in the diff we are going to build upon that is the next step.
2019-06-04 11:18:50 +01:00
Steven Cooney a97efb1597 Fix SharedParameters Issue and Tidy-up
There was an issue in which we assumed that the phabricator settings were always set, this is obviously incorrect so check that they exist before attempting to add them to shared parameters for the agent to use.

Also gone through and tidied up a few loose ends highlighted by SonarQube.
2019-06-04 11:04:25 +01:00
Steven Cooney 951fe608b7 Make Logging Class Generic
Allow either the agent or server loggers to be used with the wrapper class by making the set method use the interface rather than concrete class. Also rename the interface away from C# style naming.
2019-06-03 17:27:19 +01:00
Steven Cooney 7172047135 Setup Shared Parameters for Builds
Since there is limited access to parameters in the early stages of a build we need to pass through the shared parameters from the server to the agent. Once the BuildContext has these parameters we can then go forward and check all the required information is present before trying to patch in our revision changes.
2019-06-03 17:14:07 +01:00
Steven Cooney 82aa3d1405 Update Harbormaster Defined Parameter Names
We were previously setting the phabricator variabels we needs within builds to be environment variables however there are issues arount pulling out ENVS when on the agent within `buildStarted` step. To resolve the lack of environment variable access we are going to use sharedParameters which also doesn't work with variables prefixed with `env.` hence the rename.
2019-06-03 17:10:39 +01:00
Steven Cooney 31b2a424c8 Add .gitattributes file 2019-06-03 11:47:37 +01:00
Steven Cooney 57ff16d304 Send Build Result to Harbormaster
Once a build with the phabricator build feature configured is completed then the build status will be sent back to harbormaster.
2019-06-03 11:23:30 +01:00
Steven Cooney 13e6efd89e Change logging format.
Does what it says on the tin
2019-05-31 14:45:52 +01:00
Steven Cooney b2d8bff4f9 Parse Phabricator Config Variables and Check all is Correct
We are now parsing the phabractor variables and checking the ones we need are present. If there is no phabricator url then the process end likewise if there is a missing configuration variable the process ends too.
2019-05-31 14:44:51 +01:00
Steven Cooney 265318a9ce Rename Phabricator Variables Injected to TC builds
To make sure there are no naming conflicts with teamcity environment variable we are renaming the vars injected to the build via the harbormaster trigger.
2019-05-31 12:37:30 +01:00
Steven Cooney 5f25b065aa Tidy up and add error option to logging
Formatted the files so far getting rid of theose pesky tabs. Also added the error logging options to the logging wrapper classes.
2019-05-31 12:22:55 +01:00
Steven Cooney 82ed9cc10b Add Build Tracker which Listens for Build Result
Add a build tracker that is spun up when a bulid is created. The tracker will collect environment variables and wait for the build to finish before reporting the results.
2019-05-31 12:18:06 +01:00
Steven Cooney b083db56ac Add Logging Wrapper for Plugin
Add a wrapper to the logging commands to allow us to identify the plugin outputs
2019-05-30 16:17:45 +01:00
Steven Cooney 96a32ef190 Add Server Build Feature Definition
Add the UI for the phabricator plugin build feature configuration.
2019-05-30 15:45:32 +01:00
Steven Cooney 0dbf491410 Add Basic TeamCity Phabricator Plugin
Using TeamCity plugin template create an empty client and server plugin which will report back to phabricator
2019-05-30 13:53:15 +01:00
Steven Cooney 11558ddf54 Add Harbormaster TeamCity Plugin
The complete plugin required to trigger a teamcity build from a harbormaster build plan.
2019-05-30 13:16:13 +01:00
Steven Cooney 8f54f6f69b Initial Commit 2019-05-30 13:08:17 +01:00