|  | 
|  | 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-$(Date:yyyyMMdd).$(Rev:r).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