Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

teamcity-client

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

teamcity-client

Teamcity Client for Node.js

  • 1.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

Teamcity Node.js client

const TeamcityClient = require('teamcity-client');

const api = new TeamcityClient({
    host: 'teamcity.domain.com',
    user: 'username', // optional
    password: 'pwd' // optional
});

builds

Get detail info about build

const options = {
    tags: ['production', 'tested'],
    user: 'username'
};

// get last build by criteria
api.build.detail(options)
   .then(buildInfo => console.log(buildInfo))
   .catch(err => console.error(err));

// get build by id
api.build.detail({id: 'my-build-id'})
   .then(buildInfo => console.log(buildInfo))
   .catch(err => console.error(err));

// get build by number
api.build.detail({number: '537'})
   .then(buildInfo => console.log(buildInfo))
   .catch(err => console.error(err));

Get list of builds by criteria

api.build.list({buildType: {id: 'project-id'}})
   .then(buildList => console.log(buildList))

api.build.list({buildType: {id: 'project-id'}, tags: ['production']})
   .then(buildList => console.log(buildList))

You can use all build locator params to get build

artifacts

Download source

const fs = require('q-io/fs');

api.artifact.content(options, 'relative/path/to/source')
   .then(blob => fs.write('data.zip', blob))

Get metadata

api.artifact.meta(options, 'source.json')
   .then(data => console.log(data));

Response example

{
  "name": "source.json",
  "size": 25360,
  "modificationTime": "20151202T183212+0300",
  "href": "/guestAuth/app/rest/builds/id:10/artifacts/metadata/source.json",
  "content": {
    "href": "/guestAuth/app/rest/builds/id:10/artifacts/content/source.json"
  }
}

Get children list

api.artifact.children(options, 'relative/path')
   .then(data => console.log(JSON.stringify(data, null, 2)))

Response example

{
  "count": 1,
  "file": [
    {
      "name": "pathA",
      "modificationTime": "2T183246+0300",
      "href": "/guestAuth/app/rest/builds/id:4869415/artifacts/metadata/relative/path/pathA",
      "children": {
        "href": "/guestAuth/app/rest/builds/id:4869415/artifacts/children/relative/path/pathA"
      }
    },
  ]
}

Download archived sources

Download zip with all js-files in directory relative/path

api.artifact.archived(options, 'relative/path', '**/*.js')
   .then(blob => fs.write('data.zip', blob))

tags

Get tags

api.tags.get(locator)
   .then(data => console.log(data))

Add tags

api.tags.add(locator, ['tag1', 'tag2'])
   .then(data => console.log(data))

api.tags.add(locator, 'new_tag')
   .then(data => console.log(data))

Replace tags

api.tags.replace(locator, ['tag1', 'tag2'])
   .then(data => console.log(data))

api.tags.add(locator, 'new_tag')
   .then(data => console.log(data))

changes

Get changes list

api.changes.list(buildId)
   .then(data => console.log(data))

Get changes list with details

api.changes.list(buildId, {withDetails: true})
   .then(data => console.log(data))

Get particular change details

api.changes.detail(changeId)
   .then(data => console.log(data))

Keywords

FAQs

Package last updated on 16 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc