teamcity-connector
A client that will connect to teamcity API to perform all functions for maintaining projects
Last updated 4 years ago by wenisman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install teamcity-connector 
SYNC missed versions from official npm registry.

teamcity-connector

A client that will connect to teamcity API to perform all functions for maintaining projects

#Usage

##Creating the connector Create a new TeamcityConnector

let connector = new TeamcityConnector('http://localhost:8111', 'user', 'password');

##Projects All project work is located under the Project property of the TeamcityConnector

###Get a project To retrieve an existing project you can search for the project by name

let projectDetails = connector.project.get({name: 'Project Name'});

###Create a Project To create a project you just need the name of the project to create and the id of the parent project. If this is a new project created from scratch you do not need to provide a parent project anf the new project will be placed under the root.

let result = connector.project.create({name: 'My Subproject', parent: 'Parent Project Name'});

##BuildTypes The buildTypes are the definitions used when creating a TeamcityBuild, you will need to create this after you create your project

###Get A BuildType To locate a BuildType you will need to know its name and the name of the project that it belongs to

let buildTypeDetail = connector.buildtype.get({name: 'BuildType Name', project: 'Project Name'});

###Create a new BuildType Creating a basic BuildType can be done manually or you can use a template, to use the template just provide the Id of the template you wish to use. If you leave the template Id empty then no template will be used you can substitute the project name for projectId

let result = connector.buildtype.create({name: 'My Buildtype', projectName: 'Project Name', template: 'TemplateId'});

let result = connector.buildtype.create({name: 'My Buildtype', projectId: 'Project_Id', template: 'TemplateId'});

Adding Parameters

When you have created your BuildType you will want to amend the Parameters for your deployments

let result = connector.buildtype.addParameters({
  buildTypeId: 'build_type_id',
  parameters: [
    { name: parameter1, value: value1 },
    { name: parameter2: value: value2 }
  ]
})

##VcsRoot All builds needs to get their source form somewhere, so provide an VcsRoot ###Get an existing VcsRoot

let vcsrootDetail = connector.VcsRoot().get({name: 'VcsRoot name'});

###Create a VcsRoot Creating a VcsRoot is more involved,

let result = connector.vcsroot.create({
  name: 'VcsRoot Name',
  projectName: 'Project Name',
  projectId: 'ProjectId',
  url: 'Repository Url',
  branch: 'Branch name',
  vcsType: 'Type name'    
});

Adding Properties

When you have created your Vcs Root you will want to amend the Properties

let result = connector.vcsroot.addProperties({
  name: 'VcsRoot Name',
  properties: [
    { name: property1, value: value1 },
    { name: property2: value: value2 }
  ]
})

This is a lot of options but lets go through them

  • name - this is the name of the VcsRoot and is Required
  • projectName - the name of the project to create the VcsRoot in
  • projectId - the Id of the project of the project, you must have either this or the project name specified
  • url - the url to the Repository, this is mandatory
  • branch - the name of the branch to use
  • vcsType - the type of VcsRoot to create [jetbrains.get|perforce|svn|tfs]

#Testing ##Docker To test the library you can set up a new TeamCity server using JetBrains Docker container

docker pull jetbrains/teamcity-server
docker run -p 8111:8111 -d jetbrains/teamcity-server

Current Tags

  • 0.0.16                                ...           latest (4 years ago)

16 Versions

  • 0.0.16                                ...           4 years ago
  • 0.0.15                                ...           4 years ago
  • 0.0.14                                ...           4 years ago
  • 0.0.13                                ...           4 years ago
  • 0.0.12                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (18)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |