diff --git a/tools/pipelines/build-client.yml b/tools/pipelines/build-client.yml index db411edda75f..2177e119b308 100644 --- a/tools/pipelines/build-client.yml +++ b/tools/pipelines/build-client.yml @@ -207,12 +207,12 @@ extends: # to the "pack" stage since it can use the already-packed packages in that case. As it is the pipeline packs some # packages twice. - { name: "ci:test:jest", jobName: "JestTest" } - - { name: "ci:test:realsvc:tinylicious", jobName: "RealsvcTinyliciousTest" } - - { name: "ci:test:stress:tinylicious", jobName: "StressTinyliciousTest" } - - { name: "check:are-the-types-wrong", jobName: "AreTheTypesWrong" } + # - { name: "ci:test:realsvc:tinylicious", jobName: "RealsvcTinyliciousTest" } + # - { name: "ci:test:stress:tinylicious", jobName: "StressTinyliciousTest" } + # - { name: "check:are-the-types-wrong", jobName: "AreTheTypesWrong" } coverageTests: - { name: "ci:test:mocha", jobName: "MochaTest" } - - { name: "ci:test:realsvc:local", jobName: "RealsvcLocalTest" } + # - { name: "ci:test:realsvc:local", jobName: "RealsvcLocalTest" } testResultDirs: - nyc/examples - nyc/experimental diff --git a/tools/pipelines/templates/build-npm-client-package.yml b/tools/pipelines/templates/build-npm-client-package.yml index 57d1f7d2ed11..0e290bd11788 100644 --- a/tools/pipelines/templates/build-npm-client-package.yml +++ b/tools/pipelines/templates/build-npm-client-package.yml @@ -147,6 +147,12 @@ resources: type: git name: 1ESPipelineTemplates/M365GPT ref: refs/tags/release + pipelines: + # Listing this pipeline as a resource makes its artifacts automatically downloaded within a deployment job. + - pipeline: buildTools-resource + project: internal + source: Build - build-tools + branch: main extends: # The pipeline extends the 1ES pipeline template which will inject different SDL and compliance tasks. @@ -187,6 +193,9 @@ extends: # Install all dependencies, not just the root ones dependencyInstallCommand: pnpm install --frozen-lockfile + # Test deployment job + - template: /tools/pipelines/templates/test-template-deployment-job.yml@self + # Install / Build / Test Stage - stage: build displayName: Build Stage diff --git a/tools/pipelines/templates/build-npm-package.yml b/tools/pipelines/templates/build-npm-package.yml index c308fe9dfc14..3c49984cb801 100644 --- a/tools/pipelines/templates/build-npm-package.yml +++ b/tools/pipelines/templates/build-npm-package.yml @@ -146,6 +146,12 @@ resources: type: git name: 1ESPipelineTemplates/M365GPT ref: refs/tags/release + pipelines: + # Listing this pipeline as a resource makes its artifacts automatically downloaded within a deployment job. + - pipeline: buildTools-resource + project: internal + source: Build - build-tools + branch: main extends: # The pipeline extends the 1ES pipeline template which will inject different SDL and compliance tasks. diff --git a/tools/pipelines/templates/include-publish-npm-package-deployment.yml b/tools/pipelines/templates/include-publish-npm-package-deployment.yml index 7b276394ef02..e4978c3d5181 100644 --- a/tools/pipelines/templates/include-publish-npm-package-deployment.yml +++ b/tools/pipelines/templates/include-publish-npm-package-deployment.yml @@ -43,9 +43,23 @@ parameters: jobs: - deployment: publish_${{ replace(parameters.environment, '-', '_') }} + # Depend on the build job + # dependsOn: checkoutAndUploadThisRepoAsArtifact displayName: Publish ${{ parameters.environment }} pool: ${{ parameters.pool }} environment: ${{ parameters.environment }} + # This templateContext section is necessary for 1ES compliance for deployment jobs. + # see https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/releasepipelines/releaseworkflows/releasejob?tabs=combined-pipeline for more info. + templateContext: + type: releaseJob + isProduction: true + # Inputs here are automatically downloaded at the beginning of the job. + inputs: + - input: pipelineArtifact + artifactName: pack + buildType: current + targetPath: $(Pipeline.Workspace)/pack + workspace: clean: all variables: @@ -55,24 +69,45 @@ jobs: runOnce: deploy: steps: - - checkout: self - clean: true - persistCredentials: true # Necessary for creation of git tags to work - - download: current - artifact: pack - template: /tools/pipelines/templates/include-use-node-version.yml@self - - template: /tools/pipelines/templates/include-install-build-tools.yml@self - parameters: - buildDirectory: ${{ parameters.buildDirectory }} - buildToolsVersionToInstall: ${{ parameters.buildToolsVersionToInstall }} - pnpmStorePath: ${{ parameters.pnpmStorePath }} - - template: /tools/pipelines/templates/include-publish-npm-package-steps.yml@self - parameters: - artifactPath: tarballs - feedUrl: ${{ parameters.feedUrl }} - customEndPoint: ${{ parameters.customEndPoint }} - feedKind: ${{ parameters.feedKind }} - publishFlags: ${{ parameters.publishFlags }} - - template: /tools/pipelines/templates/include-git-tag-steps.yml@self - parameters: - tagName: ${{ parameters.tagName }} + + - task: Bash@3 + name: listFilesInWorkspace + displayName: List files in worksspace + inputs: + targetType: 'inline' + workingDirectory: '$(Pipeline.Workspace)' + script: | + echo "Listing files in directory: $(pwd)" + ls -la + + - task: Bash@3 + name: InstallBuildToolsFromTarball + displayName: Install Fluid Build Tools from Artifact Tarball + inputs: + targetType: 'inline' + workingDirectory: '$(Pipeline.Workspace)/buildTools-resource/pack/tarballs' + script: | + echo "Listing files in directory: $(pwd)" + ls -la + echo "attempting tarball install" + npm i -g ./*.tgz + + # - template: /tools/pipelines/templates/include-publish-npm-package-steps.yml@self + # parameters: + # artifactPath: tarballs + # feedUrl: ${{ parameters.feedUrl }} + # customEndPoint: ${{ parameters.customEndPoint }} + # feedKind: ${{ parameters.feedKind }} + # publishFlags: ${{ parameters.publishFlags }} + +# - job: gitTagForBuild +# displayName: Push Git Tag for Build +# dependsOn: publish_${{ replace(parameters.environment, '-', '_') }} +# steps: +# - checkout: self +# clean: true +# persistCredentials: true # Necessary for creation of git tags to work +# - template: /tools/pipelines/templates/include-git-tag-steps.yml@self +# parameters: +# tagName: ${{ parameters.tagName }} diff --git a/tools/pipelines/templates/test-template-deployment-job.yml b/tools/pipelines/templates/test-template-deployment-job.yml new file mode 100644 index 000000000000..1e54024ef3c1 --- /dev/null +++ b/tools/pipelines/templates/test-template-deployment-job.yml @@ -0,0 +1,64 @@ +# Copyright (c) Microsoft Corporation and contributors. All rights reserved. +# Licensed under the MIT License. + +# include-publish-npm-package-deployment + +parameters: +- name: pool + type: object + default: Small-eastus2 +- name: environment + type: string + default: test-package-build-feed + +jobs: +- deployment: publish_${{ replace(parameters.environment, '-', '_') }} + # Depend on the build job + # dependsOn: checkoutAndUploadThisRepoAsArtifact + displayName: Publish ${{ parameters.environment }} + pool: ${{ parameters.pool }} + environment: ${{ parameters.environment }} + # This templateContext section is necessary for 1ES compliance for deployment jobs. + # see https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/releasepipelines/releaseworkflows/releasejob?tabs=combined-pipeline for more info. + templateContext: + type: releaseJob + isProduction: true + # Inputs here are automatically downloaded at the beginning of the job. + # inputs: + # - input: pipelineArtifact + # artifactName: pack + # buildType: current + # targetPath: $(Pipeline.Workspace)/pack + + workspace: + clean: all + variables: + version: $[ stageDependencies.build.build.outputs['SetVersion.version']] + isLatest: $[ stageDependencies.build.build.outputs['SetVersion.isLatest']] + strategy: + runOnce: + deploy: + steps: + - template: /tools/pipelines/templates/include-use-node-version.yml@self + + - task: Bash@3 + name: listFilesInWorkspace + displayName: List files in worksspace + inputs: + targetType: 'inline' + workingDirectory: '$(Pipeline.Workspace)' + script: | + echo "Listing files in directory: $(pwd)" + ls -la + + - task: Bash@3 + name: InstallBuildToolsFromTarball + displayName: Install Fluid Build Tools from Artifact Tarball + inputs: + targetType: 'inline' + workingDirectory: '$(Pipeline.Workspace)/buildTools-resource/pack/tarballs' + script: | + echo "Listing files in directory: $(pwd)" + ls -la + echo "attempting tarball install" + npm i -g ./*.tgz