Skip to content

Commit 1c91317

Browse files
1ES Pipelines Template Adoption (#572)
* 1ES Pipelines Template Adoption - Added 1Es templates ci - Changed pools for Windows/Ubuntu to 1ES pools * 1ES Pipelines Template Adoption - Disable release for testing * 1ES Pipelines Template Adoption - Add eslint exception * Revert "1ES Pipelines Template Adoption" This reverts commit 27b1358.
1 parent 956a7cb commit 1c91317

File tree

4 files changed

+128
-60
lines changed

4 files changed

+128
-60
lines changed

.azure-pipelines/azure-pipelines.yml

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,66 @@
99
# npm test
1010
# vsce package
1111
# (give VSIX to someone for buddy testing)
12+
13+
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
14+
# This pipeline will be extended to the OneESPT template
1215
trigger:
1316
- main
1417

1518
# no `pr` keyword because we want all PRs to run this
1619

17-
pool:
18-
vmImage: ubuntu-20.04
19-
20-
steps:
21-
# for convenience, we tag CI-produced packages with a version number
22-
# pointing to the commit which was built. for PRs, also include the PR #.
23-
- bash: |
24-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
20+
resources:
21+
repositories:
22+
- repository: 1ESPipelineTemplates
23+
type: git
24+
name: 1ESPipelineTemplates/1ESPipelineTemplates
25+
ref: refs/tags/release
26+
extends:
27+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
28+
parameters:
29+
settings:
30+
skipBuildTagsForGitHubPullRequests: true
31+
# featureFlags:
32+
# autoBaseline: false
33+
sdl:
34+
baseline:
35+
baselineSet: default
36+
baselineFile: $(Build.SourcesDirectory)/.gdn/.gdnbaselines
37+
sourceAnalysisPool:
38+
name: Azure-Pipelines-1ESPT-ExDShared
39+
image: windows-2022
40+
os: windows
41+
pool:
42+
name: Azure-Pipelines-1ESPT-ExDShared
43+
image: ubuntu-latest
44+
os: linux
45+
customBuildTags:
46+
- ES365AIMigrationTooling
47+
stages:
48+
- stage: stage
49+
jobs:
50+
- job: job
51+
templateContext:
52+
outputs:
53+
- output: pipelineArtifact
54+
displayName: 'Publish VSIX'
55+
artifactName: azure-pipelines-vscode
56+
targetPath: $(Build.ArtifactStagingDirectory)
57+
steps:
58+
# for convenience, we tag CI-produced packages with a version number
59+
# pointing to the commit which was built. for PRs, also include the PR #.
60+
- bash: |
61+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
2562
26-
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then
27-
VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD)
28-
else
29-
VERSION_STRING=${PACKAGE_VERSION}-ci-$(git rev-parse --short HEAD)
30-
fi
63+
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then
64+
VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD)
65+
else
66+
VERSION_STRING=${PACKAGE_VERSION}-ci-$(git rev-parse --short HEAD)
67+
fi
3168
32-
npm --no-git-tag-version version $VERSION_STRING
33-
echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}"
34-
echo "$PACKAGE_VERSION" > version.txt
35-
displayName: Set version number of package and build
69+
npm --no-git-tag-version version $VERSION_STRING
70+
echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}"
71+
echo "$PACKAGE_VERSION" > version.txt
72+
displayName: Set version number of package and build
3673
37-
- template: common-steps.yml
74+
- template: /.azure-pipelines/common-steps.yml@self

.azure-pipelines/common-steps.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,3 @@ steps:
6060
branch.txt
6161
minichangelog.txt
6262
targetFolder: $(Build.ArtifactStagingDirectory)
63-
64-
# Publish files as an artifact
65-
- task: PublishPipelineArtifact@1
66-
displayName: Publish VSIX
67-
inputs:
68-
artifact: azure-pipelines-vscode
69-
targetPath: $(Build.ArtifactStagingDirectory)

.azure-pipelines/release-pipeline.yml

Lines changed: 72 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,80 @@
33
# Uses the common build logic, but also gains capabilities related to releasing the product.
44

55
# Only trigger manually
6-
trigger: none
7-
pr: none
86

9-
pool:
10-
vmImage: ubuntu-20.04
7+
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
8+
# This pipeline will be extended to the OneESPT template
119

12-
steps:
13-
# release version should be correctly set in package.json
14-
- bash: |
15-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
16-
echo "##vso[build.updatebuildnumber]${PACKAGE_VERSION}_release_${BUILD_BUILDID}"
17-
echo "$PACKAGE_VERSION" > version.txt
18-
displayName: Set version number of build
10+
trigger: none
11+
pr: none
12+
resources:
13+
repositories:
14+
- repository: 1ESPipelineTemplates
15+
type: git
16+
name: 1ESPipelineTemplates/1ESPipelineTemplates
17+
ref: refs/tags/release
18+
extends:
19+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
20+
parameters:
21+
settings:
22+
skipBuildTagsForGitHubPullRequests: true
23+
# featureFlags:
24+
# autoBaseline: false
25+
sdl:
26+
baseline:
27+
baselineSet: default
28+
baselineFile: $(Build.SourcesDirectory)/.gdn/.gdnbaselines
29+
sourceAnalysisPool:
30+
name: Azure-Pipelines-1ESPT-ExDShared
31+
image: windows-2022
32+
os: windows
33+
pool:
34+
name: Azure-Pipelines-1ESPT-ExDShared
35+
image: ubuntu-latest
36+
os: linux
37+
customBuildTags:
38+
- ES365AIMigrationTooling
39+
stages:
40+
- stage: stage
41+
jobs:
42+
- job: job
43+
templateContext:
44+
outputs:
45+
- output: pipelineArtifact
46+
displayName: 'Publish VSIX'
47+
artifactName: azure-pipelines-vscode
48+
targetPath: $(Build.ArtifactStagingDirectory)
49+
steps:
50+
# release version should be correctly set in package.json
51+
- bash: |
52+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
53+
echo "##vso[build.updatebuildnumber]${PACKAGE_VERSION}_release_${BUILD_BUILDID}"
54+
echo "$PACKAGE_VERSION" > version.txt
55+
displayName: Set version number of build
1956
20-
# do all the normal build stuff
21-
- template: common-steps.yml
57+
# do all the normal build stuff
58+
- template: /.azure-pipelines/common-steps.yml@self
2259

23-
# if the mini changelog is empty, complain
24-
- bash: |
25-
LINE_COUNT=$(cat minichangelog.txt | wc -l)
26-
if [ "$LINE_COUNT" -lt 3 ]; then
27-
echo Mini changelog is too short. Did you use the wrong version number in CHANGELOG.txt?
28-
exit 1
29-
fi
30-
displayName: Check for length of mini-changelog
60+
# if the mini changelog is empty, complain
61+
- bash: |
62+
LINE_COUNT=$(cat minichangelog.txt | wc -l)
63+
if [ "$LINE_COUNT" -lt 3 ]; then
64+
echo Mini changelog is too short. Did you use the wrong version number in CHANGELOG.txt?
65+
exit 1
66+
fi
67+
displayName: Check for length of mini-changelog
3168
32-
# create a GitHub Release
33-
- bash: |
34-
export npm_config_cache=$(Build.SourcesDirectory)/.azure-pipelines/github-release/npm-cache
35-
npm install
36-
displayName: Prepare to create GitHub Release
37-
workingDirectory: '$(Build.SourcesDirectory)/.azure-pipelines/github-release'
38-
- bash: |
39-
SCRIPT=.azure-pipelines/github-release/github-release.js
40-
VSIX=*.vsix
41-
VERSION=$(node -p "require('./package.json').version")
42-
node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN
43-
displayName: Create GitHub Release
44-
env:
45-
GITHUB_TOKEN: $(GitHubSecret)
69+
# create a GitHub Release
70+
- bash: |
71+
export npm_config_cache=$(Build.SourcesDirectory)/.azure-pipelines/github-release/npm-cache
72+
npm install
73+
displayName: Prepare to create GitHub Release
74+
workingDirectory: '$(Build.SourcesDirectory)/.azure-pipelines/github-release'
75+
- bash: |
76+
SCRIPT=.azure-pipelines/github-release/github-release.js
77+
VSIX=*.vsix
78+
VERSION=$(node -p "require('./package.json').version")
79+
node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN
80+
displayName: Create GitHub Release
81+
env:
82+
GITHUB_TOKEN: $(GitHubSecret)

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ async function activateYmlContributor(context: vscode.ExtensionContext) {
116116
await loadSchema(context, client, workspaceFolder);
117117
}));
118118

119+
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
119120
context.subscriptions.push(vscode.commands.registerCommand("azure-pipelines.reset-state", async () => await resetDoNotAskState(context)));
120121
}
121122

0 commit comments

Comments
 (0)