2022-10-18 08:18:33 -04:00
|
|
|
name: $(Rev:r)
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
|
|
|
|
pr: none
|
|
|
|
|
|
|
|
variables:
|
|
|
|
rConnection: 'mc-java-sc'
|
2022-10-26 10:59:13 -04:00
|
|
|
storageAccount: 'librariesminecraftnet'
|
|
|
|
storageAccountContainer: 'librariesminecraftnet'
|
2022-10-18 08:18:33 -04:00
|
|
|
keyVault: 'mc-java-vault'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: 'Build'
|
|
|
|
displayName: 'Build for release'
|
|
|
|
|
|
|
|
pool: 'MC-Build-1ES-Azure-Pipeline-Linux'
|
|
|
|
container: adoptopenjdk/openjdk8:latest
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: Gradle@2
|
|
|
|
displayName: Build and Test
|
|
|
|
inputs:
|
|
|
|
workingDirectory: ''
|
|
|
|
gradleWrapperFile: 'gradlew'
|
|
|
|
gradleOptions: '-Xmx3072m'
|
|
|
|
options: '-PbuildNumber=$(Build.BuildNumber)'
|
|
|
|
javaHomeOption: 'JDKVersion'
|
|
|
|
jdkUserInputPath: '/usr/java/openjdk-8'
|
|
|
|
testResultsFiles: '**/TEST-*.xml'
|
|
|
|
tasks: 'build test publish report'
|
|
|
|
|
|
|
|
# This is a workaround for ComponentGovernanceComponentDetection@0 not recognizing the generated `.pom` file(s)
|
|
|
|
- task: Bash@3
|
|
|
|
displayName: Copy pom for component governance
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: |
|
|
|
|
pompath=`find build/repo -name *.pom`
|
|
|
|
cp "${pompath}" build/pom.xml
|
|
|
|
|
|
|
|
- task: ComponentGovernanceComponentDetection@0
|
|
|
|
inputs:
|
|
|
|
scanType: 'Register'
|
|
|
|
verbosity: 'Verbose'
|
|
|
|
alertWarningLevel: 'High'
|
|
|
|
|
|
|
|
- publish: 'build/repo/'
|
|
|
|
artifact: repo
|
|
|
|
|
|
|
|
- job: 'Publish'
|
|
|
|
displayName: 'Publish release'
|
|
|
|
dependsOn: Build
|
2022-10-18 08:35:32 -04:00
|
|
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
2022-10-18 08:18:33 -04:00
|
|
|
|
|
|
|
pool: 'MC-Build-1ES-Azure-Pipeline-Linux'
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- download: current
|
|
|
|
artifact: repo
|
|
|
|
|
|
|
|
- task: AzureKeyVault@1
|
|
|
|
displayName: 'Fetching secrets'
|
|
|
|
name: secrets
|
|
|
|
inputs:
|
|
|
|
azureSubscription: '$(rConnection)'
|
|
|
|
KeyVaultName: '$(keyVault)'
|
2023-03-27 14:48:42 -04:00
|
|
|
SecretsFilter: 'access-key-prod-librariesminecraftnet'
|
2022-10-18 08:18:33 -04:00
|
|
|
RunAsPreJob: false
|
|
|
|
|
|
|
|
- task: AzureCLI@2
|
|
|
|
displayName: Azure CLI
|
|
|
|
inputs:
|
|
|
|
azureSubscription: '$(rConnection)'
|
|
|
|
scriptType: 'bash'
|
|
|
|
scriptLocation: 'inlineScript'
|
|
|
|
inlineScript: |
|
2022-10-26 10:59:13 -04:00
|
|
|
az storage blob upload-batch -s '$(Pipeline.Workspace)/repo' -d $(storageAccountContainer) --account-name $(storageAccount) --account-key $(access-key-prod-librariesminecraftnet)
|