@@ -818,8 +818,8 @@ private void createPV() throws Exception {
818
818
InputStream pv_is =
819
819
new FileInputStream (
820
820
new File (
821
- BaseTest .getProjectRoot ()
822
- + "/kubernetes/ samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml" ));
821
+ BaseTest .getResultDir ()
822
+ + "/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml" ));
823
823
pvMap = yaml .load (pv_is );
824
824
pv_is .close ();
825
825
pvMap .put ("domainUID" , domainUid );
@@ -890,21 +890,38 @@ private void generateInputYaml() throws Exception {
890
890
}
891
891
892
892
private void callCreateDomainScript (String outputDir ) throws Exception {
893
- StringBuffer createDomainScriptCmd = new StringBuffer (BaseTest .getProjectRoot ());
894
893
894
+ // copy create domain py script for domain on pv case
895
+ if (domainMap .containsKey ("createDomainPyScript" )
896
+ && !domainMap .containsKey ("domainHomeImageBase" )) {
897
+ Files .copy (
898
+ new File (BaseTest .getProjectRoot () + "/" + domainMap .get ("createDomainPyScript" ))
899
+ .toPath (),
900
+ new File (
901
+ BaseTest .getResultDir ()
902
+ + "/samples/scripts/create-weblogic-domain/domain-home-on-pv/wlst/create-domain.py" )
903
+ .toPath (),
904
+ StandardCopyOption .REPLACE_EXISTING );
905
+ }
906
+
907
+ StringBuffer createDomainScriptCmd = new StringBuffer (BaseTest .getResultDir ());
908
+
909
+ // call different create-domain.sh based on the domain type
895
910
if (domainMap .containsKey ("domainHomeImageBase" )) {
896
- // clone docker sample from github
911
+
912
+ // clone docker sample from github and copy create domain py script for domain in image case
897
913
gitCloneDockerImagesSample (domainMap );
914
+
898
915
createDomainScriptCmd
899
916
.append (
900
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh -u " )
917
+ "/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh -u " )
901
918
.append (BaseTest .getUsername ())
902
919
.append (" -p " )
903
920
.append (BaseTest .getPassword ())
904
921
.append (" -k -i " );
905
922
} else {
906
923
createDomainScriptCmd .append (
907
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh -v -i " );
924
+ "/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh -v -i " );
908
925
}
909
926
createDomainScriptCmd .append (generatedInputYamlFile );
910
927
@@ -1130,27 +1147,31 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
1130
1147
domainMap = inputDomainMap ;
1131
1148
this .userProjectsDir = BaseTest .getUserProjectsDir ();
1132
1149
this .projectRoot = BaseTest .getProjectRoot ();
1150
+
1151
+ // copy samples to RESULT_DIR
1152
+ TestUtils .exec (
1153
+ "cp -rf " + BaseTest .getProjectRoot () + "/kubernetes/samples " + BaseTest .getResultDir ());
1154
+
1133
1155
this .voyager =
1134
1156
System .getenv ("LB_TYPE" ) != null && System .getenv ("LB_TYPE" ).equalsIgnoreCase ("VOYAGER" );
1135
1157
if (System .getenv ("INGRESSPERDOMAIN" ) != null ) {
1136
1158
INGRESSPERDOMAIN = new Boolean (System .getenv ("INGRESSPERDOMAIN" )).booleanValue ();
1137
1159
}
1160
+
1138
1161
domainMap .put ("domainName" , domainMap .get ("domainUID" ));
1139
1162
1140
1163
// read sample domain inputs
1141
1164
String sampleDomainInputsFile =
1142
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml" ;
1165
+ "/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml" ;
1143
1166
if (domainMap .containsKey ("domainHomeImageBase" )) {
1144
1167
sampleDomainInputsFile =
1145
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml" ;
1168
+ "/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml" ;
1146
1169
}
1147
1170
Yaml dyaml = new Yaml ();
1148
1171
InputStream sampleDomainInputStream =
1149
- new FileInputStream (new File (BaseTest .getProjectRoot () + sampleDomainInputsFile ));
1172
+ new FileInputStream (new File (BaseTest .getResultDir () + sampleDomainInputsFile ));
1150
1173
logger .info (
1151
- "loading domain inputs template file "
1152
- + BaseTest .getProjectRoot ()
1153
- + sampleDomainInputsFile );
1174
+ "loading domain inputs template file " + BaseTest .getResultDir () + sampleDomainInputsFile );
1154
1175
Map <String , Object > sampleDomainMap = dyaml .load (sampleDomainInputStream );
1155
1176
sampleDomainInputStream .close ();
1156
1177
@@ -1191,9 +1212,9 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
1191
1212
domainMap .put ("logHome" , "/shared/logs/" + domainUid );
1192
1213
if (!domainMap .containsKey ("domainHomeImageBase" )) {
1193
1214
domainMap .put ("domainHome" , "/shared/domains/" + domainUid );
1194
- domainMap .put (
1195
- "createDomainFilesDir" ,
1196
- BaseTest .getProjectRoot () + "/integration-tests/src/test/resources/domain-home-on-pv" );
1215
+ /* domainMap.put(
1216
+ "createDomainFilesDir",
1217
+ BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/domain-home-on-pv"); */
1197
1218
domainMap .put ("image" , imageName + ":" + imageTag );
1198
1219
}
1199
1220
@@ -1359,14 +1380,15 @@ private void gitCloneDockerImagesSample(Map domainMap) throws Exception {
1359
1380
+ " "
1360
1381
+ result .stdout ());
1361
1382
}
1362
- // copy script to cloned location
1363
- Files .copy (
1364
- new File (
1365
- BaseTest .getProjectRoot ()
1366
- + "/integration-tests/src/test/resources/domain-home-on-image/create-wls-domain.py" )
1367
- .toPath (),
1368
- new File (domainHomeImageBuildPath + "/container-scripts/create-wls-domain.py" ).toPath (),
1369
- StandardCopyOption .REPLACE_EXISTING );
1383
+
1384
+ // copy create domain py script to cloned location
1385
+ if (domainMap .containsKey ("createDomainPyScript" )) {
1386
+ Files .copy (
1387
+ new File (BaseTest .getProjectRoot () + "/" + domainMap .get ("createDomainPyScript" ))
1388
+ .toPath (),
1389
+ new File (domainHomeImageBuildPath + "/container-scripts/create-wls-domain.py" ).toPath (),
1390
+ StandardCopyOption .REPLACE_EXISTING );
1391
+ }
1370
1392
}
1371
1393
}
1372
1394
0 commit comments