Authenticate to Atlassian Bamboo API via OAuth2 or basic with Axios
$ npm install @absolunet/bamboo-connector
const BambooConnector = require('@absolunet/bamboo-connector');
const basicBamboo = new BambooConnector({
auth: {
type: 'basic',
username: 'lkjhgfdsa',
secret: 'mnbvcxz'
},
url: 'https://bamboo.domain.com:8085'
}); // axios instance
const oauthBamboo = new BambooConnector({
auth: {
type: 'oauth2',
key: 'zyxwvutsrqponmlkji',
secret: 'abcdefghijklmnopqrstuvwxyz012345'
},
url: 'https://bamboo.domain.com:8085'
}); // 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
});