Skip to content

Release #206

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
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)