From 038356bfe0cf16533418dbf7aee0828feeb6db32 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Wed, 21 Feb 2024 14:42:07 +0800 Subject: [PATCH 01/21] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..7438c7453 --- /dev/null +++ b/azure-pipelines.yml @@ -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' From 3ca5a7a97bfbb06aafe0b91cc00895a80b6141eb Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Wed, 21 Feb 2024 15:44:10 +0800 Subject: [PATCH 02/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7438c7453..aa624597d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,22 +1,9 @@ # 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 +pool: + name: local -trigger: -- main +trigger: none -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' +steps: +- script: echo Hello, world! + displayName: 'Run a one-line script' \ No newline at end of file From d579d945664de3cb39026829b9c2a00f52b00587 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Wed, 21 Feb 2024 15:47:29 +0800 Subject: [PATCH 03/21] Set up CI with Azure Pipelines second test [skip ci] --- azure-pipelines-1.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 azure-pipelines-1.yml diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 000000000..7438c7453 --- /dev/null +++ b/azure-pipelines-1.yml @@ -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' From 6e59ed1e9df44d561e3e947310a37189f17f32d5 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Wed, 21 Feb 2024 16:58:40 +0800 Subject: [PATCH 04/21] Update azure-pipelines-1.yml for Azure Pipelines --- azure-pipelines-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml index 7438c7453..862a13d9f 100644 --- a/azure-pipelines-1.yml +++ b/azure-pipelines-1.yml @@ -7,7 +7,7 @@ trigger: - main pool: - vmImage: ubuntu-latest + name: local steps: - task: Maven@3 From 85015f5f065a5b5d842dbc58d8446d0afd362a85 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Wed, 21 Feb 2024 17:03:06 +0800 Subject: [PATCH 05/21] Update azure-pipelines-1.yml for Azure Pipelines --- azure-pipelines-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml index 862a13d9f..7438c7453 100644 --- a/azure-pipelines-1.yml +++ b/azure-pipelines-1.yml @@ -7,7 +7,7 @@ trigger: - main pool: - name: local + vmImage: ubuntu-latest steps: - task: Maven@3 From 674d3e6f8f5f00b498beaca29444df5289d716fe Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 22 Feb 2024 09:29:51 +0800 Subject: [PATCH 06/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa624597d..30f2517dd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,4 +6,12 @@ trigger: none steps: - script: echo Hello, world! - displayName: 'Run a one-line script' \ No newline at end of file + displayName: 'Run a one-line script' + + +- task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: "JaCoCo" + summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/site/jacoco/jacoco.xml" + reportDirectory: "$(System.DefaultWorkingDirectory)/**/site/jacoco" + failIfCoverageEmpty: true \ No newline at end of file From a629825bf177e1395568da5ae3a115134e42fe69 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 22 Feb 2024 11:04:57 +0800 Subject: [PATCH 07/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 30f2517dd..15f70680b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,9 +9,3 @@ steps: displayName: 'Run a one-line script' -- task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: "JaCoCo" - summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/site/jacoco/jacoco.xml" - reportDirectory: "$(System.DefaultWorkingDirectory)/**/site/jacoco" - failIfCoverageEmpty: true \ No newline at end of file From d1a7d168e14e24cc6994c15f8c8d9e9906aaf180 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 16:01:36 +0800 Subject: [PATCH 08/21] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 15f70680b..ae65f66ce 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,11 +1,39 @@ -# Maven -pool: - name: local +trigger: +- main +- release -trigger: none +pool: + vmImage: 'ubuntu-latest' -steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' +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 = @{ + retain = $true + 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) From 28a915c80b76f4c8a0fcd87c34568a570e5a5c7d Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 16:08:42 +0800 Subject: [PATCH 09/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ae65f66ce..ba04c684d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,7 +23,6 @@ jobs: $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)?api-version=6.0" $body = @{ - retain = $true keepforever = $true } | ConvertTo-Json From 6af07bbc5afec0a3f9aa29ba815d29ad09a01e41 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:17:55 +0800 Subject: [PATCH 10/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba04c684d..76ab40746 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,4 +35,7 @@ jobs: displayName: 'Retain Build' env: System.AccessToken: $(System.AccessToken) - + + - script: | + echo ##vso[build.addbuildtag]MyTag + displayName: 'Add Tag to Build' From 7d4c242a14331df86bda1469711860695fd23e8a Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:21:24 +0800 Subject: [PATCH 11/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 76ab40746..50a943ce1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,6 +36,24 @@ jobs: env: System.AccessToken: $(System.AccessToken) - - script: | - echo ##vso[build.addbuildtag]MyTag - displayName: 'Add Tag to Build' + - powershell: | + $personalAccessToken = "$(System.AccessToken)" + $buildId = "$(Build.BuildId)" + $projectId = "$(System.TeamProjectId)" + $organizationUrl = "$(System.CollectionUri)" + + $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=6.0" + + $body = @{ + tags = @("TestTag") + } | ConvertTo-Json + + $headers = @{ + Authorization = "Bearer $personalAccessToken" + Content-Type = "application/json" + } + + Invoke-RestMethod -Uri $uri -Method Post -Body $body -Headers $headers + displayName: 'Add Tags to Build' + env: + System.AccessToken: $(System.AccessToken) From c65667f00e88cbaaca72564fb37fce27ccdf8229 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:22:57 +0800 Subject: [PATCH 12/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 50a943ce1..b5a24845e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,7 +50,7 @@ jobs: $headers = @{ Authorization = "Bearer $personalAccessToken" - Content-Type = "application/json" + "Content-Type" = "application/json" } Invoke-RestMethod -Uri $uri -Method Post -Body $body -Headers $headers From e0f3daac0d3c3f01d6e188b303eb3a544d690418 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:38:00 +0800 Subject: [PATCH 13/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b5a24845e..ba1ccb9da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,7 +45,7 @@ jobs: $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=6.0" $body = @{ - tags = @("TestTag") + tags = @("Test", "TestTag") } | ConvertTo-Json $headers = @{ From abbe225387266947fb93abeadeaeccb912ddcd8e Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:41:24 +0800 Subject: [PATCH 14/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba1ccb9da..d511f78f4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,11 +41,12 @@ jobs: $buildId = "$(Build.BuildId)" $projectId = "$(System.TeamProjectId)" $organizationUrl = "$(System.CollectionUri)" - + $tagName = "v1.0.$(Build.BuildId)" + $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=6.0" $body = @{ - tags = @("Test", "TestTag") + "tags" = @($tagName) } | ConvertTo-Json $headers = @{ From 6fa0a8bb303ee2376159d4b9b43f6d1eb7e5956f Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:46:38 +0800 Subject: [PATCH 15/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d511f78f4..ee409d82d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,12 +41,11 @@ jobs: $buildId = "$(Build.BuildId)" $projectId = "$(System.TeamProjectId)" $organizationUrl = "$(System.CollectionUri)" - $tagName = "v1.0.$(Build.BuildId)" - $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=6.0" + $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=7.1-preview.3" $body = @{ - "tags" = @($tagName) + "Test" } | ConvertTo-Json $headers = @{ From b6d7d92d8593b5cf61aaae05251a1a64461e6716 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:49:29 +0800 Subject: [PATCH 16/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ee409d82d..19638fe78 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,7 +45,7 @@ jobs: $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=7.1-preview.3" $body = @{ - "Test" + "Test","Test Tag" } | ConvertTo-Json $headers = @{ From 172445598991376b4586b5680d0b02f50e1307c3 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:51:07 +0800 Subject: [PATCH 17/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 19638fe78..1be2c9a8d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,7 +45,7 @@ jobs: $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=7.1-preview.3" $body = @{ - "Test","Test Tag" + "Test" = "Test Tag" } | ConvertTo-Json $headers = @{ From c8873c2c82e07eb5cc58ad5d93e6d475ff7115a2 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Thu, 4 Jul 2024 17:53:45 +0800 Subject: [PATCH 18/21] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1be2c9a8d..7eb1bbcab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,18 +42,14 @@ jobs: $projectId = "$(System.TeamProjectId)" $organizationUrl = "$(System.CollectionUri)" - $uri = "$($organizationUrl)$($projectId)/_apis/build/builds/$($buildId)/tags?api-version=7.1-preview.3" - - $body = @{ - "Test" = "Test Tag" - } | ConvertTo-Json - + $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 Post -Body $body -Headers $headers + Invoke-RestMethod -Uri $uri -Method Put -Headers $headers displayName: 'Add Tags to Build' env: System.AccessToken: $(System.AccessToken) From 97d48f808563ff265a9bde594aa833849212f4bc Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Fri, 5 Jul 2024 17:41:16 +0800 Subject: [PATCH 19/21] Test Test --- Test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Test.txt diff --git a/Test.txt b/Test.txt new file mode 100644 index 000000000..345e6aef7 --- /dev/null +++ b/Test.txt @@ -0,0 +1 @@ +Test From 0bb0174c3b2e137d543a15622308594ec80663dd Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Fri, 5 Jul 2024 17:42:07 +0800 Subject: [PATCH 20/21] Test --- Test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test.txt b/Test.txt index 345e6aef7..2069d6e51 100644 --- a/Test.txt +++ b/Test.txt @@ -1 +1 @@ -Test +Test1 From bfabddc95f04b6b6ce4531b5a92aa746d4045ea9 Mon Sep 17 00:00:00 2001 From: Shiraha <1120328875@qq.com> Date: Fri, 5 Jul 2024 19:10:44 +0800 Subject: [PATCH 21/21] Test --- Test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test.txt b/Test.txt index 2069d6e51..d2cc75597 100644 --- a/Test.txt +++ b/Test.txt @@ -1 +1 @@ -Test1 +Test12