Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pipeline #9648

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 1 addition & 91 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,11 @@ variables:
- group: sonarsource-build-variables
- group: artifactory_access
- group: digicert-keylocker
# ARTIFACTORY_URL https://repox.jfrog.io/repox => https://repox.jfrog.io/artifactory
# JFROG_URL https://repox.jfrog.io
# https://github.com/SonarSource/parent-oss/blob/master/pom.xml#L708-L711
- name: ARTIFACTORY_DEPLOY_USERNAME
value: $[variables.ARTIFACTORY_QA_DEPLOYER_USERNAME]
# ~https://github.com/SonarSource/re-ci-images/blob/master/docker/mvn/settings-private.xml
- name: ARTIFACTORY_PRIVATE_USERNAME
value: $[variables.ARTIFACTORY_PRIVATE_READER_USERNAME]
- name: ARTIFACTORY_QA_READER_USERNAME
value: $[variables.ARTIFACTORY_PRIVATE_READER_USERNAME]
# pipelines-yaml-templates/promote-stage.yml line 56
- name: ARTIFACTORY_API_USER
value: $[variables.ARTIFACTORY_PROMOTER_USERNAME]
- name: ARTIFACTORY_API_KEY
value: $[variables.ARTIFACTORY_PROMOTER_ACCESS_TOKEN]
- name: UnitTestProjectPath
value: 'analyzers\tests\SonarAnalyzer.Test\'
- name: UnitTestResultsPath
Expand Down Expand Up @@ -173,24 +163,6 @@ stages:
pathToPublish: '$(Build.ArtifactStagingDirectory)/packages'
artifactName: 'NuGet Packages'

- task: JFrogNuGet@1
displayName: 'Publish SonarAnalyzer.CFG NuGet on repox'
inputs:
command: 'push'
artifactoryConnection: 'repox_qa_deployer_token'
targetDeployRepo: '$(ARTIFACTORY_NUGET_REPO)'
module: SonarAnalyzer.CFG
pathToNupkg: '$(Build.ArtifactStagingDirectory)/packages/SonarAnalyzer.CFG.*.nupkg'
collectBuildInfo: true
buildName: sonar-dotnet_nuget
buildNumber: '$(Build.BuildId)'

- task: JFrogPublishBuildInfo@1
inputs:
artifactoryConnection: 'repox_qa_deployer_token'
buildName: sonar-dotnet_nuget
buildNumber: '$(Build.BuildId)'

- task: PublishPipelineArtifact@1
displayName: 'Publish analyzer binaries as pipeline artifact'
inputs:
Expand Down Expand Up @@ -444,15 +416,6 @@ stages:
inputs:
pollingTimeoutSec: '300'

- powershell: .\scripts\Mend\Mend-Scan.ps1
displayName: "Mend scan"
condition: eq(variables.isReleaseBranch, 'True')
env:
WS_PRODUCTNAME: '$(MEND_PRODUCTNAME)'
WS_APIKEY: '$(MEND_APIKEY)'
BUILD_NUMBER: '$(Build.BuildId)'
GIT_SHA: '$(Build.SourceVersion)'

- job: runIntegrationTestsJob
displayName: '.NET ITs'
workspace:
Expand Down Expand Up @@ -507,26 +470,6 @@ stages:
parameters:
mavenSettingsFilePath: $(mavenSettings.secureFilePath)

- task: Maven@3
displayName: 'Maven deploy'
env:
ARTIFACTORY_DEPLOY_PASSWORD: $(ARTIFACTORY_QA_DEPLOYER_ACCESS_TOKEN)
PGP_PASSPHRASE: $(PGP_PASSPHRASE)
GITHUB_BRANCH: $(Build.SourceBranchName)
GIT_SHA1: $(Build.SourceVersion)
inputs:
${{ if eq(variables.isReleaseBranch, 'True') }}:
goals: 'deploy -P release,sign'
${{ else }}:
goals: 'deploy -P release'
options: >-
$(commonMavenArguments)
--settings $(mavenSettings.secureFilePath)
publishJUnitResults: false
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
mavenOptions: $(MAVEN_OPTS)

- job: runJavaUnitTests
displayName: 'Java UTs'
dependsOn: runJavaBuild
Expand Down Expand Up @@ -639,37 +582,4 @@ stages:
testRunTitle: '$(Agent.JobName)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
mavenOptions: $(MAVEN_OPTS)

- stage: promoteNugets
displayName: Promote NuGet on repox
dependsOn: qa
condition: succeeded()
jobs:
- job: promoteRepox
displayName: 'SonarAnalyzer.CFG'
workspace:
clean: all
steps:
- template: set-azp-variables-steps.yml@pipelines-yaml-templates

- task: JFrogBuildPromotion@1
inputs:
artifactoryConnection: 'repox_promoter_token'
buildName: sonar-dotnet_nuget
buildNumber: '$(Build.BuildId)'
sourceRepo: '$(ARTIFACTORY_NUGET_REPO)'
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
targetRepo: sonarsource-nuget-dev
${{ else }}:
targetRepo: sonarsource-nuget-public
status: 'it-passed'
includeDependencies: false
copy: false
dryRun: false

- template: promote-stage.yml@pipelines-yaml-templates
parameters:
stageName: 'Artifacts:'
stageDependencies:
- promoteNugets
mavenOptions: $(MAVEN_OPTS)
Loading