@absolunet/bamboo-connector 中文文档教程
@absolunet/bamboo-connector
通过 OAuth2 或基本的 Axios 对 Atlassian Bamboo API 进行身份验证
Install
$ npm install @absolunet/bamboo-connector
Usage
const BambooConnector = require('@absolunet/bamboo-connector');
const basicBamboo = new BambooConnector({
auth: {
type: 'basic',
username: 'lkjhgfdsa',
secret: 'mnbvcxz'
},
url: 'https://bamboo.domain.com'
}); // axios instance
const oauthBamboo = new BambooConnector({
auth: {
type: 'oauth2',
key: 'zyxwvutsrqponmlkji',
secret: 'abcdefghijklmnopqrstuvwxyz012345'
},
url: 'https://bamboo.domain.com'
}); // axios instance
然后,您可以直接调用 API
basicBamboo.get(`/rest/api/latest/result/${PROJECT_KEY}-${PLAN_KEY}`)
.then((results) => {
// do wathever you want
});
@absolunet/bamboo-connector
Authenticate to Atlassian Bamboo API via OAuth2 or basic with Axios
Install
$ npm install @absolunet/bamboo-connector
Usage
const BambooConnector = require('@absolunet/bamboo-connector');
const basicBamboo = new BambooConnector({
auth: {
type: 'basic',
username: 'lkjhgfdsa',
secret: 'mnbvcxz'
},
url: 'https://bamboo.domain.com'
}); // axios instance
const oauthBamboo = new BambooConnector({
auth: {
type: 'oauth2',
key: 'zyxwvutsrqponmlkji',
secret: 'abcdefghijklmnopqrstuvwxyz012345'
},
url: 'https://bamboo.domain.com'
}); // axios instance
Then, you can make direct API calls
basicBamboo.get(`/rest/api/latest/result/${PROJECT_KEY}-${PLAN_KEY}`)
.then((results) => {
// do wathever you want
});
更多