-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datasource/azure-pipelines-tasks): add
azure-pipelines-tasks
d…
…atasource
- Loading branch information
1 parent
8e28c67
commit 1b97a86
Showing
5 changed files
with
245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 153 additions & 0 deletions
153
lib/modules/datasource/azure-pipelines-tasks/built-in.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
export const BuiltInAzurePipelinesTaskMajorVersions: Map<string, string[]> = | ||
new Map<string, string[]>([ | ||
['ant', ['1']], | ||
['androidsigning', ['2', '3']], | ||
['appcenterdistribute', ['1', '2', '3']], | ||
['appcentertest', ['1']], | ||
['archivefiles', ['2']], | ||
['automatedanalysis', ['0']], | ||
['azureappservicemanage', ['0']], | ||
['azureappservicesettings', ['1']], | ||
['azurecli', ['1', '2']], | ||
['azurecloudpowershelldeployment', ['1']], | ||
['azurefilecopy', ['1', '2', '3', '4', '5']], | ||
['azurefunctionappcontainer', ['1']], | ||
['azurefunctionapp', ['1', '2']], | ||
['azurefunctiononkubernetes', ['0']], | ||
['azurefunction', ['1']], | ||
['azureiotedge', ['2']], | ||
['azurekeyvault', ['1', '2']], | ||
['azuremonitoralerts', ['0']], | ||
['azuremonitor', ['1', '1']], | ||
['azuremysqldeployment', ['1']], | ||
['azurenlbmanagement', ['1']], | ||
['azurepolicy', ['0']], | ||
['azurepowershell', ['2', '3', '4', '5']], | ||
['azureresourcegroupdeployment', ['2']], | ||
['azureresourcemanagertemplatedeployment', ['3']], | ||
['azurermwebappdeployment', ['3', '4']], | ||
['azurespringcloud', ['0']], | ||
['azurestaticwebapp', ['0']], | ||
['azurevmssdeployment', ['0']], | ||
['azurewebappcontainer', ['1']], | ||
['azurewebapp', ['1']], | ||
['bash', ['3']], | ||
['batchscript', ['1']], | ||
['cmake', ['1']], | ||
['curluploader', ['2']], | ||
['cachebeta', ['0', '1']], | ||
['cache', ['2']], | ||
['chefknife', ['1']], | ||
['chef', ['1']], | ||
['cmdline', ['2']], | ||
['cocoapods', ['0']], | ||
['condaenvironment', ['0', '1']], | ||
['containerbuild', ['0']], | ||
['containerstructuretest', ['0']], | ||
['copyfilesoverssh', ['0']], | ||
['copyfiles', ['2']], | ||
['decryptfile', ['1']], | ||
['delay', ['1']], | ||
['deletefiles', ['1']], | ||
['deployvisualstudiotestagent', ['2']], | ||
['dockercompose', ['0']], | ||
['dockerinstaller', ['0']], | ||
['docker', ['0', '1', '2']], | ||
['dotnetcorecli', ['2']], | ||
['dotnetcoreinstaller', ['0', '1']], | ||
['downloadbuildartifacts', ['0', '1']], | ||
['downloadfileshareartifacts', ['0']], | ||
['downloadgithubnpmpackage', ['1']], | ||
['downloadgithubnugetpackage', ['1']], | ||
['downloadgithubrelease', ['0']], | ||
['downloadpackage', ['0', '1']], | ||
['downloadpipelineartifact', ['0', '1', '2']], | ||
['downloadsecurefile', ['1']], | ||
['duffleinstaller', ['0']], | ||
['extractfiles', ['1']], | ||
['filetransform', ['1', '2']], | ||
['ftpupload', ['1', '2']], | ||
['functoolsinstaller', ['0']], | ||
['githubcomment', ['0']], | ||
['githubrelease', ['0', '1']], | ||
['gotool', ['0']], | ||
['go', ['0']], | ||
['gradle', ['2', '3']], | ||
['grunt', ['0']], | ||
['gulp', ['0', '1']], | ||
['helmdeploy', ['0']], | ||
['helminstaller', ['0', '1']], | ||
['iiswebappdeployment', ['1']], | ||
['iiswebappdeploymentonmachinegroup', ['0']], | ||
['iiswebappmanagementonmachinegroup', ['0']], | ||
['installapplecertificate', ['2']], | ||
['installappleprovisioningprofile', ['1']], | ||
['installsshkey', ['0']], | ||
['invokerestapi', ['1']], | ||
['javatoolinstaller', ['0']], | ||
['jenkinsdownloadartifacts', ['1']], | ||
['jenkinsqueuejob', ['2']], | ||
['kubectlinstaller', ['0']], | ||
['kubernetesmanifest', ['0']], | ||
['kubernetes', ['0', '1']], | ||
['msbuild', ['1']], | ||
['manualintervention', ['8']], | ||
['manualvalidation', ['0']], | ||
['mavenauthenticate', ['0']], | ||
['maven', ['2', '3']], | ||
['mysqldeploymentonmachinegroup', ['1']], | ||
['nodetool', ['0']], | ||
['npmauthenticate', ['0']], | ||
['npm', ['0', '1']], | ||
['nugetauthenticate', ['0', '1']], | ||
['nugetcommand', ['2']], | ||
['nugetinstaller', ['0']], | ||
['nugetpackager', ['0']], | ||
['nugetpublisher', ['0']], | ||
['nugetrestore', ['1']], | ||
['nugettoolinstaller', ['0', '1']], | ||
['nuget', ['0']], | ||
['openpolicyagentinstaller', ['0']], | ||
['packerbuild', ['0', '1']], | ||
['pipauthenticate', ['0', '1']], | ||
['powershellontargetmachines', ['1', '2', '3']], | ||
['powershell', ['2']], | ||
['publishbuildartifacts', ['1']], | ||
['publishcodecoverageresults', ['1', '2']], | ||
['publishpipelineartifact', ['0', '1']], | ||
['publishpipelinemetadata', ['0']], | ||
['publishsymbols', ['2']], | ||
['publishtestresults', ['1', '2']], | ||
['publishtoazureservicebus', ['1']], | ||
['pypipublisher', ['0']], | ||
['pythonscript', ['0']], | ||
['queryworkitems', ['0']], | ||
['quickperftest', ['1']], | ||
['reviewapp', ['0']], | ||
['runjmeterloadtest', ['1']], | ||
['runloadtest', ['1']], | ||
['servicefabriccomposedeploy', ['0']], | ||
['servicefabricdeploy', ['1']], | ||
['servicefabricpowershell', ['1']], | ||
['servicefabricupdatemanifests', ['2']], | ||
['shellscript', ['2']], | ||
['sqlazuredacpacdeployment', ['1']], | ||
['sqldacpacdeploymentonmachinegroup', ['0']], | ||
['sqlserverdacpacdeployment', ['1']], | ||
['ssh', ['0']], | ||
['twineauthenticate', ['0', '1']], | ||
['universalpackages', ['0']], | ||
['usedotnet', ['2']], | ||
['usenode', ['1']], | ||
['usepythonversion', ['0']], | ||
['userubyversion', ['0']], | ||
['vsbuild', ['1']], | ||
['vstestplatformtoolinstaller', ['1']], | ||
['vstest', ['1', '2']], | ||
['vstest', ['2']], | ||
['windowsmachinefilecopy', ['1', '2']], | ||
['xamarinandroid', ['1']], | ||
['xamarintestcloud', ['1']], | ||
['xamarinios', ['2']], | ||
['xcode', ['5']], | ||
]); |
56 changes: 56 additions & 0 deletions
56
lib/modules/datasource/azure-pipelines-tasks/index.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { getPkgReleases } from '../index'; | ||
import { AzurePipelinesTasksDatasource } from '.'; | ||
|
||
describe('modules/datasource/azure-pipelines-tasks/index', () => { | ||
it('returns null for unknown task', async () => { | ||
expect( | ||
await getPkgReleases({ | ||
datasource: AzurePipelinesTasksDatasource.id, | ||
depName: 'unknown', | ||
}) | ||
).toBeNull(); | ||
}); | ||
|
||
it('returns single version', async () => { | ||
expect( | ||
await getPkgReleases({ | ||
datasource: AzurePipelinesTasksDatasource.id, | ||
depName: 'Bash', | ||
}) | ||
).toEqual({ releases: [{ version: '3' }] }); | ||
}); | ||
|
||
it('returns multiple versions', async () => { | ||
expect( | ||
await getPkgReleases({ | ||
datasource: AzurePipelinesTasksDatasource.id, | ||
depName: 'AzureFileCopy', | ||
}) | ||
).toEqual({ | ||
releases: [ | ||
{ version: '1' }, | ||
{ version: '2' }, | ||
{ version: '3' }, | ||
{ version: '4' }, | ||
{ version: '5' }, | ||
], | ||
}); | ||
}); | ||
|
||
it('is case insensitive', async () => { | ||
expect( | ||
await getPkgReleases({ | ||
datasource: AzurePipelinesTasksDatasource.id, | ||
depName: 'AzUrEfIlEcOpY', | ||
}) | ||
).toEqual({ | ||
releases: [ | ||
{ version: '1' }, | ||
{ version: '2' }, | ||
{ version: '3' }, | ||
{ version: '4' }, | ||
{ version: '5' }, | ||
], | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { id as versioning } from '../../versioning/loose'; | ||
import { Datasource } from '../datasource'; | ||
import type { GetReleasesConfig, ReleaseResult } from '../types'; | ||
import { BuiltInAzurePipelinesTaskMajorVersions } from './built-in'; | ||
|
||
export class AzurePipelinesTasksDatasource extends Datasource { | ||
static readonly id = 'azure-pipelines-tasks'; | ||
|
||
constructor() { | ||
super(AzurePipelinesTasksDatasource.id); | ||
} | ||
|
||
override readonly caching = true; | ||
|
||
override readonly customRegistrySupport = false; | ||
|
||
override readonly defaultVersioning = versioning; | ||
|
||
getReleases({ | ||
packageName, | ||
}: GetReleasesConfig): Promise<ReleaseResult | null> { | ||
if (BuiltInAzurePipelinesTaskMajorVersions.has(packageName.toLowerCase())) { | ||
const versions = BuiltInAzurePipelinesTaskMajorVersions.get( | ||
packageName.toLowerCase() | ||
); | ||
if (versions) { | ||
const releases = versions.map((version) => ({ version })); | ||
return Promise.resolve({ releases }); | ||
} | ||
} | ||
|
||
return Promise.resolve(null); | ||
} | ||
} |
Empty file.