-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add port config discovery in azure (#964)
* add port config discovery * add yml in file types --------- Co-authored-by: kaiqianyang <kaiqianyang@microsoftcom>
- Loading branch information
1 parent
bec748c
commit 7dc4670
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
rules/rules-reviewed/azure/springboot/spring-boot-to-azure-port.windup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0"?> | ||
<ruleset id="spring-boot-to-azure-port" | ||
xmlns="http://windup.jboss.org/schema/jboss-ruleset" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd"> | ||
<metadata> | ||
<description> | ||
Identify server port configuration in Spring Boot applications. | ||
</description> | ||
<dependencies> | ||
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final"/> | ||
</dependencies> | ||
<sourceTechnology id="springboot"/> | ||
<targetTechnology id="azure-spring-apps"/> | ||
<targetTechnology id="azure-aks"/> | ||
<targetTechnology id="azure-appservice"/> | ||
<targetTechnology id="azure-container-apps"/> | ||
<tag>port</tag> | ||
</metadata> | ||
<rules> | ||
<rule id="spring-boot-to-azure-port-01000"> | ||
<when> | ||
<filecontent filename="application{*}.{extensions}" pattern="{pattern}" /> | ||
</when> | ||
<perform> | ||
<hint title="Server port configuration found" effort="0" category-id="information"> | ||
<message>The application is setting the server port. Please be aware of potential port reliance issues during the migration process</message> | ||
<tag>server port</tag> | ||
</hint> | ||
</perform> | ||
<where param="extensions"> | ||
<matches pattern="(properties|yaml|yml)" /> | ||
</where> | ||
<where param="pattern"> | ||
<matches pattern="(^|\s)server\.port" /> | ||
</where> | ||
</rule> | ||
</rules> | ||
</ruleset> |
1 change: 1 addition & 0 deletions
1
...reviewed/azure/springboot/tests/data/spring-boot-to-azure-port/application-dev.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fake.fake = test |
2 changes: 2 additions & 0 deletions
2
...les-reviewed/azure/springboot/tests/data/spring-boot-to-azure-port/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fake.fake = test | ||
server.port = 8080 |
22 changes: 22 additions & 0 deletions
22
rules/rules-reviewed/azure/springboot/tests/spring-boot-to-azure-port.windup.test.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<ruletest id="spring-boot-to-azure-port-test" xmlns="http://windup.jboss.org/schema/jboss-ruleset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd"> | ||
<testDataPath>data/spring-boot-to-azure-port</testDataPath> | ||
<rulePath>../spring-boot-to-azure-port.windup.xml</rulePath> | ||
<ruleset> | ||
<rules> | ||
<rule id="spring-boot-to-azure-port-test-01000"> | ||
<when> | ||
<not> | ||
<iterable-filter size="1"> | ||
<hint-exists message="The application is setting the server port." /> | ||
</iterable-filter> | ||
</not> | ||
</when> | ||
<perform> | ||
<fail message="spring boot server port hint was not found!" /> | ||
</perform> | ||
</rule> | ||
</rules> | ||
</ruleset> | ||
</ruletest> |