Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test12
22 changes: 22 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- main

pool:
vmImage: ubuntu-latest

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
55 changes: 55 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
trigger:
- main
- release

pool:
vmImage: 'ubuntu-latest'

variables:
tagName: 'release'

jobs:
- job: Build
steps:
- script: echo Building...
displayName: 'Run a one-line script'

- powershell: |
$personalAccessToken = "$(System.AccessToken)"
$buildId = "$(Build.BuildId)"
$projectId = "$(System.TeamProjectId)"
$organizationUrl = "$(System.CollectionUri)"

$uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)?api-version=6.0"

$body = @{
keepforever = $true
} | ConvertTo-Json

$headers = @{
Authorization = "Bearer $personalAccessToken"
"Content-Type" = "application/json"
}

Invoke-RestMethod -Uri $uri -Method Patch -Body $body -Headers $headers
displayName: 'Retain Build'
env:
System.AccessToken: $(System.AccessToken)

- powershell: |
$personalAccessToken = "$(System.AccessToken)"
$buildId = "$(Build.BuildId)"
$projectId = "$(System.TeamProjectId)"
$organizationUrl = "$(System.CollectionUri)"

$uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags/Test?api-version=7.1-preview.3"

$headers = @{
Authorization = "Bearer $personalAccessToken"
"Content-Type" = "application/json"
}

Invoke-RestMethod -Uri $uri -Method Put -Headers $headers
displayName: 'Add Tags to Build'
env:
System.AccessToken: $(System.AccessToken)