Coder Social home page Coder Social logo

xebialabs-community / xlr-tfs-plugin Goto Github PK

View Code? Open in Web Editor NEW
3.0 40.0 5.0 877 KB

Integration between XLR and TFS 2013 and TFS 2015

License: MIT License

Batchfile 2.27% Python 93.88% Shell 3.02% Dockerfile 0.83%
tfs xlr-tfs-plugin xlr xl-release tfs-sdk

xlr-tfs-plugin's Introduction

XL Release TFS plugin

Build Status Codacy Badge Code Climate License: MIT Github All Releases

Preface

This document describes the functionality provided by the XL Deploy|Release Description|Interface plugin.

See the XL Release reference manual for background information on XL Release and release automation concepts.

Overview

This plugin offers an interface from XL Release to Team Foundation Server to create, update and retrieve Work Items.

Various APIs are supported: Team Foundation Power Tools, TFS REST API, and the TFS SDK.

Requirements

  • XL Release [7.0 - 7.2]

This community-supported version was developed for versions of XL Release 7.2 and lower and for TFS versions 2013 and 2015.

Note: XebiaLabs has released an officially supported plugin, xlr-vsts-tfs-plugin-7.5.1. See the documentation at https://docs.xebialabs.com/xl-release/how-to/using-the-xl-release-vsts-tfs-plugin.html. Contact XebiaLabs for download information.

Installation

Usage

Team Foundation Power Tools

The following actions are supported:

CreateWorkItem

The CreateWorkItem.py script creates a new Work Item by executing a remote Windows batch wrapper script, CreateWorkItems.bat. Input parameters are Project, Type, Collection, Title, AssignedTo, and Description; the script returns the number of the Work Item created.

screenshot of createWorkItem

GetWorkItem

The GetWorkItem.py script retrieves a Work Item given its number and collection using the GetWorkItem.bat wrapper script. Input parameters are workItemNumber and collection.

screenshot of getWorkItem

UpdateWorkItem

The UpdateWorkItem.py script updates a Work Item given its number, collection, and set of update fields and values in the format fieldname1=value1;fieldname2=value2. See an example of setting State=Done at the end of this document.

screenshot of updateWorkItem

Notes:

The TFS machine must have Microsoft Visual Studio Team Foundation Server 2013 Update 2 Power Tools installed.

The CreateWorkItem.bat, GetWorkItem.bat, and UpdateWorkItem.bat scripts must be placed in a location on the TFS machine. The default location is C:\xlr-tfs2013-plugin.

A field is provided for the Windows CIFS port (default is 445) to allow overriding a blocked port.

The functionality will be enhanced as specific needs materialize.

TFS REST API

This plugin offers an interface from XL Release to Team Foundation Server via the REST API valid for work items in TFS 2015. It provides:

CreateWorkItem.py -- creates a Work Item given Collection, Project, Type and Title parameters

AddWorkItemComment.py -- adds a Work Item comment given Collection, Work Item Id and Comment parameters

GetTfsRepoArtifacts.py -- retrieves an item from a TFS Git repository given the collection and scopepath (assumes a single repository and a single match)

QueueBuild.py -- Queue a build using the REST api.

The functionality will be enriched with additional Work Item fields as specific needs materialize.

To test the connection on the Shared Configuration screen, you will need the SDK set up.

TFS Triggers

Using the REST API, the Plugin allows you to poll TFS repositories and trigger XL Release on changes.

GitCommitTrigger.py -- Given a Collection, Project, Repo and Branch, will trigger a release if the latest commit ID changes.

TfvcChangesetTrigger.py -- Given a Collection and Project, will trigger a release if the latest changeset ID changes.

TFS SDK

The TFS SDK depends on the following configuration changes in XL Release:

Script.policy file โ€” confirm these lines:

permission  java.util.PropertyPermission "\*", "read, write";
permission java.lang.RuntimePermission "shutdownHooks";
permission java.io.FilePermission "conf/\*", "read";
permission java.io.FilePermission "lib/\*", "read";
permission java.io.FilePermission "plugins/\*", "read";
permission java.security.AllPermission;

Add the library com.microsoft.tfs.sdk-11.0.0.jar to /plugins.

Unzip native.zip in the /conf directory.

Example configuration, TFPT

Shared Configuration

You can specify the URL for your TFS Server, Username , password , domain. Then you can specify the authentication type as Basic or NTLM dependening on the type of account you are using. The Depending on whether you are using TFSSDK( for TFS 2010-2013) or TFSREST API (2015), you can specify the value in dropdown. This will help to test the connection to target. Doesn't do test connection for CLI.

screenshot of shared Configuration

Task Usage

Here is a basic workflow of four items to create a Work Item, then retrieve it, update it, and retrieve it again to see the modification.

screenshot of release template

The variables appearing in the above screenshots are set in this manner:

screenshot of release variables

Note that workItemNumber is set as an output variable by the createWorkItem task.

Successful execution of the release results in the following output:

Create Work Item

screenshot of createWorkItem output

Get Work Item, note State=New

screenshot of createWorkItem output

Update Work Item

screenshot of createWorkItem output

Get Work Item, note State=Done

screenshot of createWorkItem output

References

xlr-tfs-plugin's People

Contributors

amitmohleji avatar droberts2013 avatar istairbn avatar jdewinne avatar ndebuhr avatar vlussenburg avatar xebialabs-se avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xlr-tfs-plugin's Issues

Plugin does not work in XL Release 5

In XL Release 5 the cifsPort field is used by the Windows Remote Script task. Therefor the server does not start when the TFS plugin is loaded. I fixed it locally by renaming the cifsPort field to cifsPortTfs. Changes need to be made in the synthetic.xml and the python scripts voor tfpt.
I was unable to create a pull request with my changes :-(

Testing connection fails

I installed the latest plugin in XLR 7.2.0
Once set the shared configuration object to point my TFS, using REST API, I do get the following error in case I do click on test button:

Can't connect to Tfs: Server.
TypeError: 'NoneType' object is unsubscriptable

Any idea why?

Thanks

Test Connection throws an ImportError

Downloaded the latest release and installed, received the following error when trying test connection over Rest API:

Can't connect to Tfs: Server.
ImportError: No module named microsoft

Looks like it's relying on the TFS core modules for the NTLM

Unable to queue 2015 build definitions

I have two 2015 build definitions and one old xaml definition on a team project. I have my shared configuration set up as sdk but I'm thinking it needs to be set up as REST. When running an SDK queue build task it connects to the team project but is only finding the one xaml build.

Queue build in TFS instance via this REST API: http://tfs.hsn.net:8080/tfs/DefaultCollection
Build server version: [Build Server Version: 4]
Found 1 build definition(s).
Exception during execution:
com.microsoft.tfs.core.clients.build.exceptions.BuildDefinitionNotFoundException: com.microsoft.tfs.core.clients.build.exceptions.BuildDefinitionNotFoundException: TF214006: No build definition was found for team project MerchPlanSC with name Merch-Oracle-Main. in <script> at line number 54

When I try to set the shared configuration up as a REST connection I'm unable to connect. Is there some kind of TFS extension or plugin I need to have installed on the TFS box to allow this connection type?

XL Release does not start after copying com.microsoft.tfs.sdk-14.0.3.jar to lib/

When starting the server after I have copied this file, the following error is thrown:

2016-07-18 08:47:43.578 [main] {} INFO c.x.xlplatform.config.ConfigLoader$ - Loading xl-release.conf
2016-07-18 08:47:43.937 [main] {} INFO c.x.xlrelease.XLReleaseBootstrapper - XL Release version 5.0.0 (built at 16-04-20 19:52:51)
2016-07-18 08:47:43.939 [main] {} INFO c.x.xlrelease.XLReleaseBootstrapper - (c) 2012-2016 XebiaLabs, Inc.

2016-07-18 08:47:44.200 [main] {} INFO c.x.xlrelease.XLReleaseBootstrapper - Reading configuration file from: /opt/xlr/xl-release-5.0.0-server/conf/xl-release-server.conf
2016-07-18 08:47:44.200 [main] {} INFO c.x.xlrelease.XLReleaseBootstrapper - Starting server...
2016-07-18 08:47:44.399 [main] {} ERROR c.x.xlrelease.XLReleaseBootstrapper - Fatal error starting server
java.lang.NoSuchMethodError: com.google.common.io.Files.asByteSource(Ljava/io/File;)Lcom/google/common/io/ByteSource;
at com.xebialabs.deployit.ServerConfigFile.readConfigurationFile(ServerConfigFile.java:67) ~[appserver-core-2016.1.0.jar:na]
at com.xebialabs.deployit.ServerConfigFile.readConfiguration(ServerConfigFile.java:59) ~[appserver-core-2016.1.0.jar:na]
at com.xebialabs.deployit.ServerConfigFile.loadConfig(ServerConfigFile.java:40) ~[appserver-core-2016.1.0.jar:na]
at com.xebialabs.deployit.ServerConfigFile.loadConfig(ServerConfigFile.java:35) ~[appserver-core-2016.1.0.jar:na]
at com.xebialabs.xlrelease.XLReleaseBootstrapper.startServer(XLReleaseBootstrapper.java:106) [server-5.0.0.jar:na]
at com.xebialabs.xlrelease.XLReleaseBootstrapper.start(XLReleaseBootstrapper.java:76) [server-5.0.0.jar:na]
at com.xebialabs.xlrelease.XLReleaseBootstrapper.main(XLReleaseBootstrapper.java:49) [server-5.0.0.jar:na]

The weird thing is that is does not occur on every XL Release instance. But I can't find out what is causing this.

TFS Trigger

The new update allowing XLR triggers based on TFS check ins looks to be set up to only trigger for check ins to a project; is there a way to trigger based on a check in/merge to a specific branch for a project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.