Skip to content

Commit

Permalink
Migrate to 1ES pipeline (#1428)
Browse files Browse the repository at this point in the history
* Migrate to 1ES pipeline
  • Loading branch information
jdneo committed Jan 18, 2024
1 parent 0a98107 commit 63839e6
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 11 deletions.
70 changes: 70 additions & 0 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger:
branches:
include:
- main
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
customBuildTags:
- MigrationTooling-mseng-VSJava-9181-Tool
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Java-Debug-CI
templateContext:
outputs:
- output: pipelineArtifact
artifactName: vsix
targetPath: $(Build.ArtifactStagingDirectory)/vsix
displayName: "Publish Artifact: vsix"
steps:
- checkout: self
fetchTags: true
- task: JavaToolInstaller@0
displayName: Use Java 17
inputs:
versionSpec: "17"
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: Npm@1
displayName: npm install
inputs:
verbose: false
- task: CmdLine@2
displayName: build server
inputs:
script: |-
git clone https://github.com/microsoft/java-debug ../java-debug
npm run build-server
- task: CmdLine@2
displayName: vsce package
inputs:
script: npx @vscode/vsce@latest package
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)/vsix"
inputs:
Contents: "*.vsix"
TargetFolder: $(Build.ArtifactStagingDirectory)/vsix
93 changes: 93 additions & 0 deletions .azure-pipelines/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
schedules:
- cron: 0 7 * * 1,2,3,4,5
branches:
include:
- refs/heads/main
resources:
pipelines:
- pipeline: microsoft.java-debug.signjars.nightly
source: microsoft.java-debug.signjars.nightly
trigger:
branches:
include:
- refs/heads/main
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger: none
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
customBuildTags:
- MigrationTooling-mseng-VSJava-13475-Tool
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Java-Debug-Nightly
templateContext:
outputs:
- output: pipelineArtifact
artifactName: vsix
targetPath: $(Build.ArtifactStagingDirectory)/vsix
displayName: "Publish Artifact: vsix"
steps:
- checkout: self
fetchTags: false
- task: DownloadBuildArtifacts@1
displayName: Download Build Artifacts
inputs:
buildType: specific
project: a4d27ce2-a42d-4b71-8eef-78cee9a9728e
definition: "16485"
specificBuildWithTriggering: true
downloadType: specific
itemPattern: plugin/jars/com.microsoft.java.debug.plugin-*.jar
extractTars: false
- task: CmdLine@2
displayName: cp plugin.jar to server
inputs:
script: |-
mkdir -p server
cp $(System.ArtifactsDirectory)/plugin/jars/com.microsoft.java.debug.plugin-*[!a-zA-Z].jar server/
ls -l server/
- task: Npm@1
displayName: npm install
inputs:
verbose: false
- task: CmdLine@2
displayName: Update nightly vsix version
inputs:
script: node scripts/build/prepare-nightly-build.js
- task: CmdLine@2
displayName: Replace AI key
inputs:
script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\""
- task: CmdLine@2
displayName: vsce package --pre-release
inputs:
script: npx @vscode/vsce@latest package --pre-release
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)/vsix"
inputs:
Contents: "*.vsix"
TargetFolder: $(Build.ArtifactStagingDirectory)/vsix
84 changes: 84 additions & 0 deletions .azure-pipelines/rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
resources:
pipelines:
- pipeline: microsoft.java-debug.signjars.rc
source: microsoft.java-debug.signjars.rc
trigger:
branches:
include:
- main
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger: none
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
customBuildTags:
- MigrationTooling-mseng-VSJava-9157-Tool
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Java-Debug-RC
templateContext:
outputs:
- output: pipelineArtifact
artifactName: vsix
targetPath: $(Build.ArtifactStagingDirectory)/vsix
displayName: "Publish Artifact: vsix"
steps:
- checkout: self
fetchTags: true
- task: DownloadBuildArtifacts@1
displayName: Download Build Artifacts
inputs:
buildType: specific
project: a4d27ce2-a42d-4b71-8eef-78cee9a9728e
definition: "16486"
specificBuildWithTriggering: true
downloadType: specific
itemPattern: m2/com.microsoft.java.debug.plugin/com.microsoft.java.debug.plugin-*.jar
extractTars: false
- task: CmdLine@2
displayName: cp plugin.jar to server
inputs:
script: |-
mkdir -p server
cp $(System.ArtifactsDirectory)/m2/com.microsoft.java.debug.plugin/com.microsoft.java.debug.plugin-*[!a-zA-Z].jar server/
ls -l server/
- task: Npm@1
displayName: npm install
inputs:
verbose: false
- task: CmdLine@2
displayName: Replace AI key
inputs:
script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\""
- task: CmdLine@2
displayName: vsce package
inputs:
script: npx @vscode/vsce@latest package
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)/vsix"
inputs:
Contents: "*.vsix"
TargetFolder: $(Build.ArtifactStagingDirectory)/vsix
3 changes: 2 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ packages
package-lock.json
node_modules
webpack.config.js
.DS_Store
.DS_Store
.azure-pipelines/**
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@
"@types/node": "^14.18.53",
"@types/uuid": "^8.3.4",
"@types/vscode": "1.75.0",
"@vscode/test-electron": "^2.3.3",
"@vscode/test-electron": "^2.3.8",
"mocha": "^10.2.0",
"ts-loader": "^9.4.4",
"tslint": "^6.1.3",
Expand Down

0 comments on commit 63839e6

Please sign in to comment.