-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Pipelines] Migrate to 1ES pipeline. (#2474)
* Initial template * Add variables * Update appcenter-cli-1ES.yml * Add Ignored directory * Remove unnecessary repo cloning * Update dir * Update dirs * Supress value in tests * Add supress * Fix comments
- Loading branch information
1 parent
9930a9d
commit b57d905
Showing
2 changed files
with
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
trigger: none | ||
|
||
variables: | ||
- name: API_TOKEN_KEY_VAULT | ||
value: 'distributionStoresInt' | ||
- name: API_TOKEN_KEY_VAULT_AZURE_SUBSCRIPTION | ||
value: 'App Center - INT' | ||
|
||
resources: | ||
repositories: | ||
- repository: 1ESPipelineTemplates | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
|
||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
parameters: | ||
pool: | ||
name: 1ES-PT-CBL-Mariner-2.0-Gen2 | ||
os: linux | ||
customBuildTags: | ||
- ES365AIMigrationTooling-BulkMigrated | ||
sdl: | ||
sourceAnalysisPool: 1ES-PT-Windows-2022 | ||
stages: | ||
- stage: Stage | ||
jobs: | ||
- job: HostJob | ||
templateContext: | ||
outputs: | ||
- output: pipelineArtifact | ||
displayName: "Publish Artifact: artifacts" | ||
path: '$(Build.ArtifactStagingDirectory)/npm' | ||
artifactName: npm | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '14.x' | ||
displayName: 'Install Node.js' | ||
|
||
- script: | | ||
npm ci | ||
npm run build | ||
displayName: 'Install and build' | ||
- script: | | ||
npm run test:ci || [ -f './test-results.xml' ] | ||
displayName: 'Run CLI tests (with JUnit output)' | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'JUnit' | ||
testResultsFiles: 'test-results.xml' | ||
searchFolder: '$(Build.SourcesDirectory)' | ||
failTaskOnFailedTests: true | ||
testRunTitle: 'CLI unit tests' | ||
displayName: 'Verify CLI unit test result' | ||
|
||
- script: | | ||
npm ci | ||
npm run build | ||
displayName: 'Install and build appcenter-file-upload-client-node' | ||
workingDirectory: $(Build.SourcesDirectory)/appcenter-file-upload-client-node | ||
- script: | | ||
npm run test:ci || [ -f './test-results.xml' ] | ||
displayName: 'Run appcenter-file-upload-client-node tests' | ||
workingDirectory: $(Build.SourcesDirectory)/appcenter-file-upload-client-node | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'JUnit' | ||
testResultsFiles: 'test-results.xml' | ||
searchFolder: '$(Build.SourcesDirectory)/appcenter-file-upload-client-node' | ||
failTaskOnFailedTests: true | ||
testRunTitle: 'appcenter-file-upload-client-node unit tests' | ||
displayName: 'Verify appcenter-file-upload-client-node unit test result' | ||
|
||
- task: AzureKeyVault@1 | ||
inputs: | ||
azureSubscription: '$(API_TOKEN_KEY_VAULT_AZURE_SUBSCRIPTION)' | ||
KeyVaultName: '$(API_TOKEN_KEY_VAULT)' | ||
SecretsFilter: 'ac-cli-account-api-token' | ||
|
||
- task: PowerShell@2 | ||
inputs: | ||
filePath: '$(Build.SourcesDirectory)/test/functional/Invoke-FunctionalTests.ps1' | ||
arguments: '-Token $(ac-cli-account-api-token)' | ||
pwsh: true | ||
workingDirectory: $(Build.SourcesDirectory) | ||
displayName: 'Run functional tests' | ||
|
||
- script: | | ||
[ -f './test/functional/testresult.xml' ] | ||
displayName: 'Verify that functional test result file exists' | ||
workingDirectory: $(Build.SourcesDirectory) | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'NUnit' | ||
testResultsFiles: 'testresult.xml' | ||
searchFolder: '$(Build.SourcesDirectory)/test/functional' | ||
failTaskOnFailedTests: true | ||
testRunTitle: 'Functional tests' | ||
displayName: 'Verify functional test result' | ||
|
||
- script: | | ||
npm pack | ||
npm install -g appcenter-cli*.tgz | ||
displayName: 'Package appcenter-cli' | ||
workingDirectory: $(Build.SourcesDirectory) | ||
- task: DeleteFiles@1 | ||
inputs: | ||
contents: node_modules | ||
displayName: 'Delete node_modules' | ||
|
||
- task: ArchiveFiles@2 | ||
inputs: | ||
rootFolderOrFile: '$(Build.SourcesDirectory)' | ||
includeRootFolder: false | ||
archiveType: 'tar' | ||
archiveFile: '$(Build.ArtifactStagingDirectory)/npm/$(Build.BuildId).tgz' | ||
replaceExistingArchive: true | ||
verbose: true | ||
displayName: 'Prepare npm artifact' |
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