Skip to content

Commit

Permalink
Release pipeline for mgmt (#10987)
Browse files Browse the repository at this point in the history
* feat: update release pipeline

* feat: update javadoc plugin from client-parent

* feat: remove local tag when release

* feat: update release pipeline

* feat: install sdk build tools in release

* feat: exclude samples in javadoc

* feat: remove javadoc plugin in child pom
  • Loading branch information
ChenTanyi authored May 11, 2020
1 parent ca79e3d commit ac4adc1
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 219 deletions.
33 changes: 33 additions & 0 deletions eng/mgmt/pull-request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
import os
import sys
import json
import requests
import urllib.parse

def create_pull_request(owner, repo, title, head, auth = os.environ.get("GITHUB_TOKEN")):
url = "https://api.github.com/repos/{0}/{1}/pulls".format(owner, repo)
resp = requests.post(
url = url,
auth = (auth, ""),
json = {
"title": title,
"base": "master",
"head": head,
}
)
if resp.status_code == 422:
print("duplicate pull request")
print("Error: {0} for url: {1}".format(resp.reason, resp.url))
else:
resp.raise_for_status()
print(json.dumps(resp.json(), indent = 2))

def main(argv):
if len(argv) < 4:
print("Usage: {} owner repo title head [auth]".format(argv[0]))
sys.exit(1)
create_pull_request(*argv[1:6])

if __name__ == "__main__":
main(sys.argv)
13 changes: 0 additions & 13 deletions sdk/appservice/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>
15 changes: 0 additions & 15 deletions sdk/authorization/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,6 @@
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>
</project>
15 changes: 0 additions & 15 deletions sdk/compute/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>
</project>
15 changes: 0 additions & 15 deletions sdk/containerregistry/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,6 @@
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
15 changes: 0 additions & 15 deletions sdk/containerservice/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,6 @@
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
14 changes: 0 additions & 14 deletions sdk/cosmos/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,6 @@
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
15 changes: 0 additions & 15 deletions sdk/dns/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>
</project>
14 changes: 0 additions & 14 deletions sdk/keyvault/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>
15 changes: 0 additions & 15 deletions sdk/managedserviceidentity/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,6 @@
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
53 changes: 49 additions & 4 deletions sdk/management/pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,71 @@ pr: none
pool:
vmImage: 'ubuntu-18.04'

variables:
- template: ../../../eng/pipelines/templates/variables/globals.yml

steps:
- bash: |
git config --global user.name "Azure-Fluent"
git config --global user.email "azfluent@microsoft.com"
git tag | xargs git tag -d
- task: MavenAuthenticate@0
inputs:
mavenServiceConnections: azure-libraries-for-java-maven

- task: Maven@3
inputs:
mavenPomFile: eng/code-quality-reports/pom.xml
options: '$(DefaultOptions) -DskipTests=true -DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -am'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'
displayName: 'install sdk-build-tools'

- task: Maven@3
displayName: Build package with pom.xml
condition: and(succeeded(), eq(variables['Snapshot'], true))
inputs:
mavenPomFile: 'sdk/management/pom.xml'
mavenOptions: ''
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'source:jar javadoc:jar package -DskipTests'

- task: Maven@3
displayName: Uploaded package
condition: and(succeeded(), eq(variables['Snapshot'], true))
inputs:
mavenPomFile: 'sdk/management/pom.xml'
mavenOptions: ''
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'com.microsoft.azure:bundler-maven-plugin:bundle'

- task: Maven@3
displayName: Auto build release with new version
condition: ne(variables['Snapshot'], true)
inputs:
mavenPomFile: 'pom.xml'
mavenPomFile: 'sdk/management/pom.xml'
mavenOptions: '-Xmx3072m -Dversion=$(VERSION) -DdevVersion=$(DEVVERSION)-SNAPSHOT'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'com.microsoft.azure:bundler-maven-plugin:auto'

- bash: |
git log -2
git push https://$(GITHUB_TOKEN)@github.com/azure-fluent/azure-libraries-for-java HEAD:refs/heads/$(VERSION) -f
python3 tools/pull-request.py azure azure-libraries-for-java "Release $(VERSION)" "azure-fluent:$(VERSION)"
git push https://$(GITHUB_TOKEN)@github.com/azure-fluent/azure-sdk-for-java HEAD:refs/heads/$(VERSION) -f
python3 eng/mgmt/pull-request.py azure azure-sdk-for-java "Release $(VERSION)" "azure-fluent:$(VERSION)"
displayName: Create pull request
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
condition: and(succeeded(), ne(variables['Snapshot'], true))
49 changes: 40 additions & 9 deletions sdk/management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,49 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.1</version>
<configuration>
<doctitle>Microsoft Azure Management Libraries for Java ${project.version}</doctitle>
<windowtitle>Microsoft Azure Management Libraries for Java ${project.version}</windowtitle>
<source>1.8</source>
<doctitle>Azure SDK for Java Reference Documentation</doctitle>
<windowtitle>Azure SDK for Java Reference Documentation</windowtitle>
<footer>Visit the &lt;a href="https://docs.microsoft.com/java/azure/"&gt;Azure for Java Developers&lt;/a&gt;site
for more Java documentation, including quick starts, tutorials, and code samples.
</footer>
<linksource>false</linksource>
<excludePackageNames>
*.samples;*.implementation.*;*.utils.*;com.microsoft.azure.utility;*.management.billing;*.management.cognitiveservices;*.management.consumption;*.management.customerinsights;*.management.devices;*.management.devtestlab;*.management.insights;*.management.logic;*.management.machinelearning;*.management.notificationhubs;*.management.powerbi;*.management.recoveryservices;*.management.relay;*.management.scheduler;*.management.servicefabric;*.management.streamanalytics
*.impl*:
*.implementation*:
*.utils:
*.samples
</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
<groups>
<group>
<title>Azure Management</title>
<packages>com.azure.management*</packages>
</group>
</groups>
<links>
<link>https://docs.oracle.com/javase/8/docs/api/</link>
<link>https://projectreactor.io/docs/core/release/api/</link>
<link>https://netty.io/4.1/api/</link>
<link>http://reactivex.io/RxJava/javadoc/</link>
</links>
<isOffline>false</isOffline>
<doclet>org.apidesign.javadoc.codesnippet.Doclet</doclet>
<docletArtifact>
<groupId>org.apidesign.javadoc</groupId>
<artifactId>codesnippet-doclet</artifactId>
<version>0.53</version> <!-- {x-version-update;org.apidesign.javadoc:codesnippet-doclet;external_dependency} -->
</docletArtifact>
<additionalOptions>
<additionalOption>-maxLineLength 120</additionalOption>
<additionalOption>-snippetpath ${project.basedir}/src/samples/java</additionalOption>
<additionalOption>-suppressMissingLinkWarnings</additionalOption>
</additionalOptions>
<failOnError>true</failOnError>
<failOnWarnings>true</failOnWarnings>
<doclint>all</doclint>
<quiet>true</quiet>
</configuration>
</plugin>

Expand Down
15 changes: 0 additions & 15 deletions sdk/monitor/mgmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,6 @@
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
Loading

0 comments on commit ac4adc1

Please sign in to comment.