Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const buildAzurePipelines = async function () {
let authHandler = azureDevops.getPersonalAccessTokenHandler(config.azureDevops.token);
let conn = new azureDevops.WebApi(config.azureDevops.endpoint, authHandler);
var buildApi = await conn.getBuildApi();
let build = await buildApi.queueBuild({
definition: {
id: config.azureDevops.definitionId,
},
parameters:
JSON.stringify(
{
repo_url: 'https://github.com/rotorz/unity3d-localized-strings.git',
repo_branch: 'v1.0.3',
package_name: '@rotorz/unity3d-localized-strings',
package_ver: '1.0.3',
build_name: getBuildName('x', '@rotorz/unity3d-localized-strings', '1.0.3'),
// 'system.debug': true,
// 'agent.diagnostic': true,
const INTEGRATION_DIR = path.join(__dirname, '..', '_layout', 'integrations');
const GIT = 'git';
var opt = require('node-getopt').create([
['', 'dryrun', 'Dry run only, do not actually commit new release'],
['h', 'help', 'Display this help'],
])
.setHelp(
'Usage: node createAdoPrs.js [OPTION] \n' +
'\n' +
'[[OPTIONS]]\n'
)
.bindHelp() // bind option 'help' to default action
.parseSystem(); // parse command line
const authHandler = azdev.getPersonalAccessTokenHandler(process.env.PAT);
const connection = new azdev.WebApi('https://dev.azure.com/mseng', authHandler);
function createIntegrationFiles(newRelease, callback)
{
fs.mkdirSync(INTEGRATION_DIR, { recursive: true });
fs.readdirSync(INTEGRATION_DIR).forEach( function(entry) {
if (entry.startsWith('PublishVSTSAgent-'))
{
// node 12 has recursive support in rmdirSync
// but since most of us are still on node 10
// remove the files manually first
var dirToDelete = path.join(INTEGRATION_DIR, entry);
fs.readdirSync(dirToDelete).forEach( function(file) {
fs.unlinkSync(path.join(dirToDelete, file));
});
fs.rmdirSync(dirToDelete, { recursive: true });
const INTEGRATION_DIR = path.join(__dirname, '..', '_layout', 'integrations');
const GIT = 'git';
var opt = require('node-getopt').create([
['', 'dryrun', 'Dry run only, do not actually commit new release'],
['h', 'help', 'Display this help'],
])
.setHelp(
'Usage: node createAdoPr.js [OPTION] \n' +
'\n' +
'[[OPTIONS]]\n'
)
.bindHelp() // bind option 'help' to default action
.parseSystem(); // parse command line
const authHandler = azdev.getPersonalAccessTokenHandler(process.env.PAT);
const connection = new azdev.WebApi('https://dev.azure.com/mseng', authHandler);
function createIntegrationFiles(newRelease, callback)
{
fs.mkdirSync(INTEGRATION_DIR, { recursive: true });
util.versionifySync(path.join(__dirname, '..', 'src', 'Misc', 'InstallAgentPackage.template.xml'),
path.join(INTEGRATION_DIR, 'InstallAgentPackage.xml'),
newRelease
);
}
commitAndPush = function(directory, release, branch)
{
util.execInForeground(`${GIT} checkout -b ${branch}`, directory);
util.execInForeground(`${GIT} commit -m "Agent Release ${release}" `, directory);
util.execInForeground(`${GIT} push --set-upstream origin ${branch}`, directory);
async function getNodeApi() {
let authHandler = azdev.getPersonalAccessTokenHandler(azpPAT);
let connection = new azdev.WebApi('https://dev.azure.com/mseng', authHandler);
return await connection.getWorkItemTrackingApi();
}
async getBuildApi() {
let authHandler = azureDevops.getPersonalAccessTokenHandler(config.azureDevops.token);
let conn = new azureDevops.WebApi(config.azureDevops.endpoint, authHandler);
let buildApi = await conn.getBuildApi();
return buildApi;
}
}
const getBuildApi = async function() {
let authHandler = azureDevops.getPersonalAccessTokenHandler(
config.azureDevops.token
);
let conn = new azureDevops.WebApi(config.azureDevops.endpoint, authHandler);
let buildApi = await conn.getBuildApi();
return buildApi;
};