@@ -1597,17 +1597,18 @@ public void restartManagedServerUsingServerStartPolicy(String msName) throws Exc
1597
1597
}
1598
1598
1599
1599
/**
1600
- * Run the shell script to build .war file and deploy the App in the admin pod
1600
+ * Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod
1601
1601
*
1602
1602
* @param webappName - Web App Name to be deployed
1603
- * @param scriptName - a shell script to build .war file and deploy the App in the admin pod
1603
+ * @param scriptName - a shell script to build WAR, EAR or JAR file and deploy the App in the
1604
+ * admin pod
1604
1605
* @param archiveExt - archive extention
1605
1606
* @param infoDirNames - archive information dir location
1606
1607
* @param username - weblogic user name
1607
1608
* @param password - weblogc password
1608
1609
* @throws Exception
1609
1610
*/
1610
- private void callShellScriptToBuildWarDeployAppInPod (
1611
+ private void callShellScriptToBuildDeployAppInPod (
1611
1612
String webappName ,
1612
1613
String scriptName ,
1613
1614
String archiveExt ,
@@ -1678,10 +1679,11 @@ private void callShellScriptToBuildWarDeployAppInPod(
1678
1679
1679
1680
/**
1680
1681
* Create dir to save Web App files Copy the shell script file and all App files over to the admin
1681
- * pod Run the shell script to build .war file and deploy the App in the admin pod
1682
+ * pod Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod
1682
1683
*
1683
1684
* @param appName - Java App name to be deployed
1684
- * @param scriptName - a shell script to build .war file and deploy the App in the admin pod
1685
+ * @param scriptName - a shell script to build WAR, EAR or JAR file and deploy the App in the
1686
+ * admin pod
1685
1687
* @param username - weblogic user name
1686
1688
* @param password - weblogc password
1687
1689
* @param args - by default, a WAR file is created for a Web App and a EAR file is created for EJB
@@ -1698,9 +1700,12 @@ public void buildDeployJavaAppInPod(
1698
1700
String scriptPathOnHost = BaseTest .getAppLocationOnHost () + "/" + scriptName ;
1699
1701
String scriptPathInPod = BaseTest .getAppLocationInPod () + "/" + scriptName ;
1700
1702
1703
+ // Default velues to build archive file
1701
1704
final String initInfoDirName = "WEB-INF" ;
1702
1705
String archiveExt = "war" ;
1703
1706
String infoDirName = initInfoDirName ;
1707
+
1708
+ // Get archive info dir name
1704
1709
File appFiles = new File (appLocationOnHost );
1705
1710
1706
1711
String [] subDirArr =
@@ -1714,6 +1719,7 @@ public boolean accept(File dir, String name) {
1714
1719
1715
1720
List <String > subDirList = Arrays .asList (subDirArr );
1716
1721
1722
+ // Check archive file type
1717
1723
if (!subDirList .contains (infoDirName )) {
1718
1724
infoDirName = "META-INF" ;
1719
1725
// Create .ear file or .jar file for EJB
@@ -1722,10 +1728,9 @@ public boolean accept(File dir, String name) {
1722
1728
1723
1729
logger .info ("Build and deploy: " + appName + "." + archiveExt + " in the admin pod" );
1724
1730
1731
+ // Create app dir in the admin pod
1725
1732
StringBuffer mkdirCmd = new StringBuffer (" -- bash -c 'mkdir -p " );
1726
1733
mkdirCmd .append (appLocationInPod ).append ("/" + infoDirName + "'" );
1727
-
1728
- // Create app dir in the pod
1729
1734
TestUtils .kubectlexec (adminServerPod , domainNS , mkdirCmd .toString ());
1730
1735
1731
1736
// Copy shell script to the pod
@@ -1734,8 +1739,8 @@ public boolean accept(File dir, String name) {
1734
1739
// Copy all App files to the admin pod
1735
1740
TestUtils .copyAppFilesToPod (appLocationOnHost , appLocationInPod , adminServerPod , domainNS );
1736
1741
1737
- // Run the script to build .war file and deploy the App in the pod
1738
- callShellScriptToBuildWarDeployAppInPod (
1742
+ // Run the script to build WAR, EAR or JAR file and deploy the App in the admin pod
1743
+ callShellScriptToBuildDeployAppInPod (
1739
1744
appName , scriptName , archiveExt , infoDirName , username , password );
1740
1745
}
1741
1746
}
0 commit comments