Skip to content

Commit 03904d3

Browse files
migrate 1es template pipeline
1 parent 20b23e4 commit 03904d3

File tree

3 files changed

+448
-0
lines changed

3 files changed

+448
-0
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# This pipeline was generated from the classic pipeline "[IntelliJ] build-feature(endgame)-pull-request" on 2024-01-08 with https://aka.ms/1ESPTMigration (v1.1.0): https://dev.azure.com/mseng/VSJava/_build?definitionId=10967
2+
#
3+
# The following items require attention:
4+
# Variables were exported from the classic pipeline, confirm that `variables` values do not contain private information. If a variable contains private information, follow the guidance on handling secret variables: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables
5+
# No trigger found, defaulting to 'none'. Update the trigger as needed.
6+
# No name found, setting the default value '$(Date:yyyyMMdd).$(Rev:r)'. This value determines how your pipeline runs are numbered. Update the name as needed: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml
7+
8+
name: $(Date:yyyyMMdd).$(Rev:r)
9+
variables:
10+
- name: Codeql.Enabled
11+
value: true
12+
- name: GRADLE_USER_HOME
13+
value: $(Pipeline.Workspace)/.gradle
14+
- name: TOOLKIT_BRANCH
15+
value: nonexistent-branch
16+
- name: USERPROFILE
17+
value: /home/vsts
18+
resources:
19+
repositories:
20+
- repository: self
21+
type: git
22+
ref: refs/heads/develop
23+
- repository: 1esPipelines
24+
type: git
25+
name: 1ESPipelineTemplates/1ESPipelineTemplates
26+
ref: refs/tags/release
27+
trigger: none
28+
extends:
29+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
30+
parameters:
31+
pool:
32+
name: 1ES_JavaTooling_Pool
33+
image: windows-latest
34+
os: windows
35+
customBuildTags:
36+
- MigrationTooling-mseng-VSJava-10967-Tool
37+
stages:
38+
- stage: Stage
39+
jobs:
40+
- job: Job_1
41+
displayName: Agent job 1
42+
templateContext:
43+
outputs:
44+
- output: pipelineArtifact
45+
artifactName: drop
46+
targetPath: $(build.artifactstagingdirectory)/zip
47+
displayName: "Publish Artifact: drop"
48+
condition: succeededOrFailed()
49+
steps:
50+
- checkout: self
51+
clean: true
52+
fetchTags: false
53+
- task: JavaToolInstaller@0
54+
displayName: Use Java 17
55+
inputs:
56+
versionSpec: "17"
57+
jdkArchitectureOption: x64
58+
jdkSourceOption: PreInstalled
59+
- task: ms-devlabs.utilitytasks.task-Shellpp.Shellpp@0
60+
displayName: Prepare Environment
61+
inputs:
62+
type: InlineScript
63+
script: |-
64+
# Set Environment Variables
65+
export JAVA_HOME=$JAVA_HOME_17_X64
66+
export PATH=$JAVA_HOME/bin:$PATH
67+
68+
echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME"
69+
echo "##vso[task.setvariable variable=PATH]$PATH"
70+
- task: ms-devlabs.utilitytasks.task-Shellpp.Shellpp@0
71+
displayName: Build Toolkit Libs($(TOOLKIT_BRANCH) || $(System.PullRequest.SourceBranch) || $(System.PullRequest.TargetBranch) || develop)
72+
inputs:
73+
type: InlineScript
74+
script: |-
75+
CUSTOM_BRANCH=$(TOOLKIT_BRANCH)
76+
SOURCE_BRANCH=$(System.PullRequest.SourceBranch)
77+
TARGET_BRANCH=$(System.PullRequest.TargetBranch)
78+
79+
ls ~/.m2/repository/com/microsoft/azure/azure-toolkit-*
80+
cd ..
81+
git clone https://github.com/microsoft/azure-maven-plugins.git
82+
cd azure-maven-plugins
83+
84+
custom_existed_in_remote=$(git ls-remote --heads origin ${CUSTOM_BRANCH})
85+
source_existed_in_remote=$(git ls-remote --heads origin ${SOURCE_BRANCH})
86+
target_existed_in_remote=$(git ls-remote --heads origin ${TARGET_BRANCH})
87+
if [[ -n ${custom_existed_in_remote} ]]; then
88+
BRANCH=$CUSTOM_BRANCH
89+
elif [[ -n ${source_existed_in_remote} ]]; then
90+
BRANCH=$SOURCE_BRANCH
91+
elif [[ -n ${target_existed_in_remote} ]]; then
92+
BRANCH=$TARGET_BRANCH
93+
fi
94+
95+
echo "build azure-toolkit-libs: $BRANCH"
96+
git fetch origin $BRANCH
97+
git checkout $BRANCH
98+
99+
git branch
100+
mvn clean install -f azure-toolkit-libs/pom.xml -B -T 4 -Dmaven.test.skip=true -Dmdep.analyze.skip=true -Dmaven.source.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip || exit -1
101+
102+
ls ~/.m2/repository/com/microsoft/azure/azure-toolkit-*
103+
echo "cleaning up battlefield."
104+
cd ../
105+
rm -rf ./azure-maven-plugins
106+
exit 0
107+
- task: ms-devlabs.utilitytasks.task-Shellpp.Shellpp@0
108+
displayName: Build Utils
109+
inputs:
110+
type: InlineScript
111+
script: ./gradlew buildUtils -x buildToolkitsLib || exit -1
112+
- task: ms-devlabs.utilitytasks.task-Shellpp.Shellpp@0
113+
displayName: Build IntelliJ
114+
inputs:
115+
type: InlineScript
116+
script: cd PluginsAndFeatures/azure-toolkit-for-intellij && ./gradlew clean buildPlugin -s
117+
- task: ms-devlabs.utilitytasks.task-Shellpp.Shellpp@0
118+
displayName: Rename & Upload Checkstyle reports
119+
condition: succeededOrFailed()
120+
inputs:
121+
type: InlineScript
122+
script: |-
123+
./gradlew --stop
124+
sudo apt-get install rename
125+
echo "BUILD_NUMBER = $(Build.BuildNumber)"
126+
DATE=`date +%m-%d-%Y`
127+
rename "s/.zip/.develop.$(Build.BuildNumber).${DATE}.zip/" artifacts/*.zip
128+
continueOnError: true
129+
- task: CopyFiles@2
130+
displayName: "Copy Files to: $(build.artifactstagingdirectory)/zip"
131+
condition: succeededOrFailed()
132+
inputs:
133+
SourceFolder: $(Build.Repository.LocalPath)/PluginsAndFeatures/azure-toolkit-for-intellij/build/distributions
134+
Contents: "**/*.zip"
135+
TargetFolder: $(build.artifactstagingdirectory)/zip
136+
continueOnError: true
137+
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
138+
displayName: "Manifest Generator "
139+
inputs:
140+
BuildDropPath: $(build.artifactstagingdirectory)/zip
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# This pipeline was generated from the classic pipeline "[IntelliJ] sign-for-dev-release" on 2024-01-16 with https://aka.ms/1ESPTMigration (v1.1.0): https://dev.azure.com/mseng/VSJava/_build?definitionId=11383
2+
#
3+
# The following items require attention:
4+
# Variables were exported from the classic pipeline, confirm that `variables` values do not contain private information. If a variable contains private information, follow the guidance on handling secret variables: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables
5+
# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software
6+
# No trigger found, defaulting to 'none'. Update the trigger as needed.
7+
# No name found, setting the default value '$(Date:yyyyMMdd).$(Rev:r)'. This value determines how your pipeline runs are numbered. Update the name as needed: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml
8+
# The pipeline uses service connection "vscjavaci_codesign", you will need to grant the new pipeline access: https://dev.azure.com/mseng/VSJava/_settings/adminservices?resourceId=d5f51b85-6feb-48f6-a077-37426b5911f4
9+
10+
name: $(Date:yyyyMMdd).$(Rev:r)
11+
variables:
12+
- name: Codeql.Enabled
13+
value: true
14+
resources:
15+
repositories:
16+
- repository: self
17+
type: git
18+
ref: refs/heads/wangmi/1es
19+
- repository: 1esPipelines
20+
type: git
21+
name: 1ESPipelineTemplates/1ESPipelineTemplates
22+
ref: refs/tags/release
23+
trigger: none
24+
extends:
25+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
26+
parameters:
27+
pool:
28+
name: 1ES_JavaTooling_Pool
29+
image: 1ES_JavaTooling_Ubuntu-2004
30+
os: linux
31+
sdl:
32+
sourceAnalysisPool:
33+
name: 1ES_JavaTooling_Pool
34+
image: 1ES_JavaTooling_Windows_2022
35+
os: windows
36+
customBuildTags:
37+
- MigrationTooling-mseng-VSJava-11383-Tool
38+
stages:
39+
- stage: Stage
40+
jobs:
41+
- job: Job_1
42+
displayName: Build and Sign Azure Plugin for IntelliJ
43+
templateContext:
44+
outputs:
45+
- output: pipelineArtifact
46+
artifactName: drop
47+
targetPath: $(build.artifactstagingdirectory)
48+
displayName: "Publish Artifact: drop"
49+
steps:
50+
- checkout: self
51+
fetchTags: false
52+
- script: |
53+
CUSTOM_BRANCH=$(BRANCH)
54+
if [[ -n ${CUSTOM_BRANCH} ]]; then
55+
git fetch origin $(BRANCH)
56+
git checkout $(BRANCH)
57+
else
58+
echo "no need to switch branch"
59+
fi
60+
displayName: switch to $(BRANCH)
61+
- task: JavaToolInstaller@0
62+
displayName: Use Java 17
63+
inputs:
64+
versionSpec: "17"
65+
jdkArchitectureOption: x64
66+
jdkSourceOption: PreInstalled
67+
- task: Bash@3
68+
displayName: Set up environment and resources
69+
inputs:
70+
targetType: inline
71+
script: |-
72+
# Set Environment Variables
73+
export JAVA_HOME=$JAVA_HOME_17_X64
74+
export PATH=$JAVA_HOME/bin:$PATH
75+
76+
echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME"
77+
echo "##vso[task.setvariable variable=PATH]$PATH"
78+
- task: Bash@3
79+
displayName: Build Toolkit Libs@$(TOOLKIT_BRANCH)
80+
inputs:
81+
targetType: inline
82+
script: |-
83+
TARGET_BRANCH=$(TOOLKIT_BRANCH)
84+
85+
ls ~/.m2/repository/com/microsoft/azure/azure-toolkit-*
86+
cd ..
87+
git clone https://github.com/microsoft/azure-maven-plugins.git
88+
cd azure-maven-plugins
89+
90+
echo "build azure-toolkit-libs: $TARGET_BRANCH"
91+
git fetch origin $TARGET_BRANCH
92+
git checkout $TARGET_BRANCH
93+
94+
git branch
95+
mvn clean install -T 4 -Dmaven.test.skip=true -Dmdep.analyze.skip=true -Dmaven.source.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip -B|| exit -1
96+
97+
ls ~/.m2/repository/com/microsoft/azure/azure-toolkit-*
98+
echo "cleaning up battlefield."
99+
cd ../
100+
rm -rf ./azure-maven-plugins
101+
exit 0
102+
- task: Bash@3
103+
displayName: Build Utils
104+
inputs:
105+
targetType: inline
106+
script: |-
107+
# Write your commands here
108+
109+
# ./gradlew buildUtils || exit -1
110+
mvn install -f ./Utils/pom.xml -T 1C -Dcheckstyle.skip=true
111+
- task: Bash@3
112+
displayName: Build IntelliJ
113+
inputs:
114+
targetType: inline
115+
script: |
116+
(cd PluginsAndFeatures/azure-toolkit-for-intellij && ./gradlew clean buildPlugin -s -Papplicationinsights.key=$(INTELLIJ_KEY) -PneedPatchVersion=$(IS_FOR_DEV_RELEASE) -Psources=false -Porg.gradle.configureondemand=false -Porg.gradle.daemon=false -Porg.gradle.unsafe.configuration-cache=false -Porg.gradle.caching=false)
117+
118+
mkdir -p ./artifacts/intellij/
119+
cp ./PluginsAndFeatures/azure-toolkit-for-intellij/build/distributions/*.zip ./artifacts/intellij/azure-toolkit-for-intellij.zip
120+
unzip ./artifacts/intellij/azure-toolkit-for-intellij.zip -d ./artifacts/intellij/folder
121+
rm ./artifacts/intellij/azure-toolkit-for-intellij.zip
122+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3
123+
displayName: Sign IntelliJ
124+
inputs:
125+
ConnectedServiceName: vscjavaci_codesign
126+
FolderPath: artifacts/intellij/folder
127+
Pattern: azure-intellij-*.jar, azure-toolkit-*.jar, azuretools-core-*.jar,azure-explorer-common-*.jar,hdinsight-node-common-*.jar, azure-sdk-reference-book.jar
128+
signConfigType: inlineSignParams
129+
inlineOperation: |-
130+
[
131+
{
132+
"KeyCode" : "$(KEY_CODE)",
133+
"OperationCode" : "JavaSign",
134+
"Parameters" : {
135+
"SigAlg" : "SHA256withRSA",
136+
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
137+
},
138+
"ToolName" : "sign",
139+
"ToolVersion" : "1.0"
140+
},
141+
{
142+
"KeyCode" : "$(KEY_CODE)",
143+
"OperationCode" : "JavaVerify",
144+
"Parameters" : {},
145+
"ToolName" : "sign",
146+
"ToolVersion" : "1.0"
147+
}
148+
]
149+
- task: Bash@3
150+
displayName: Build IntelliJ Package
151+
inputs:
152+
targetType: inline
153+
script: |
154+
# Write your commands here
155+
156+
(cd ./artifacts/intellij/folder && zip -r ../../azure-toolkit-for-intellij-$(Build.BuildNumber).zip ./azure-toolkit-for-intellij/)
157+
- task: CopyFiles@2
158+
displayName: "Copy Files to: $(build.artifactstagingdirectory)"
159+
inputs:
160+
SourceFolder: $(system.defaultworkingdirectory)/artifacts
161+
Contents: "*.zip"
162+
TargetFolder: $(build.artifactstagingdirectory)
163+
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
164+
displayName: "Manifest Generator "
165+
inputs:
166+
BuildDropPath: $(build.artifactstagingdirectory)

0 commit comments

Comments
 (0)