@@ -810,8 +810,8 @@ private void createPV() throws Exception {
810
810
InputStream pv_is =
811
811
new FileInputStream (
812
812
new File (
813
- BaseTest .getProjectRoot ()
814
- + "/kubernetes/ samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml" ));
813
+ BaseTest .getResultDir ()
814
+ + "/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml" ));
815
815
pvMap = yaml .load (pv_is );
816
816
pv_is .close ();
817
817
pvMap .put ("domainUID" , domainUid );
@@ -882,21 +882,38 @@ private void generateInputYaml() throws Exception {
882
882
}
883
883
884
884
private void callCreateDomainScript (String outputDir ) throws Exception {
885
- StringBuffer createDomainScriptCmd = new StringBuffer (BaseTest .getProjectRoot ());
886
885
886
+ // copy create domain py script for domain on pv case
887
+ if (domainMap .containsKey ("createDomainPyScript" )
888
+ && !domainMap .containsKey ("domainHomeImageBase" )) {
889
+ Files .copy (
890
+ new File (BaseTest .getProjectRoot () + "/" + domainMap .get ("createDomainPyScript" ))
891
+ .toPath (),
892
+ new File (
893
+ BaseTest .getResultDir ()
894
+ + "/samples/scripts/create-weblogic-domain/domain-home-on-pv/wlst/create-domain.py" )
895
+ .toPath (),
896
+ StandardCopyOption .REPLACE_EXISTING );
897
+ }
898
+
899
+ StringBuffer createDomainScriptCmd = new StringBuffer (BaseTest .getResultDir ());
900
+
901
+ // call different create-domain.sh based on the domain type
887
902
if (domainMap .containsKey ("domainHomeImageBase" )) {
888
- // clone docker sample from github
903
+
904
+ // clone docker sample from github and copy create domain py script for domain in image case
889
905
gitCloneDockerImagesSample (domainMap );
906
+
890
907
createDomainScriptCmd
891
908
.append (
892
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh -u " )
909
+ "/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh -u " )
893
910
.append (BaseTest .getUsername ())
894
911
.append (" -p " )
895
912
.append (BaseTest .getPassword ())
896
913
.append (" -k -i " );
897
914
} else {
898
915
createDomainScriptCmd .append (
899
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh -v -i " );
916
+ "/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh -v -i " );
900
917
}
901
918
createDomainScriptCmd .append (generatedInputYamlFile );
902
919
@@ -1122,27 +1139,31 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
1122
1139
domainMap = inputDomainMap ;
1123
1140
this .userProjectsDir = BaseTest .getUserProjectsDir ();
1124
1141
this .projectRoot = BaseTest .getProjectRoot ();
1142
+
1143
+ // copy samples to RESULT_DIR
1144
+ TestUtils .exec (
1145
+ "cp -rf " + BaseTest .getProjectRoot () + "/kubernetes/samples " + BaseTest .getResultDir ());
1146
+
1125
1147
this .voyager =
1126
1148
System .getenv ("LB_TYPE" ) != null && System .getenv ("LB_TYPE" ).equalsIgnoreCase ("VOYAGER" );
1127
1149
if (System .getenv ("INGRESSPERDOMAIN" ) != null ) {
1128
1150
INGRESSPERDOMAIN = new Boolean (System .getenv ("INGRESSPERDOMAIN" )).booleanValue ();
1129
1151
}
1152
+
1130
1153
domainMap .put ("domainName" , domainMap .get ("domainUID" ));
1131
1154
1132
1155
// read sample domain inputs
1133
1156
String sampleDomainInputsFile =
1134
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml" ;
1157
+ "/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml" ;
1135
1158
if (domainMap .containsKey ("domainHomeImageBase" )) {
1136
1159
sampleDomainInputsFile =
1137
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml" ;
1160
+ "/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml" ;
1138
1161
}
1139
1162
Yaml dyaml = new Yaml ();
1140
1163
InputStream sampleDomainInputStream =
1141
- new FileInputStream (new File (BaseTest .getProjectRoot () + sampleDomainInputsFile ));
1164
+ new FileInputStream (new File (BaseTest .getResultDir () + sampleDomainInputsFile ));
1142
1165
logger .info (
1143
- "loading domain inputs template file "
1144
- + BaseTest .getProjectRoot ()
1145
- + sampleDomainInputsFile );
1166
+ "loading domain inputs template file " + BaseTest .getResultDir () + sampleDomainInputsFile );
1146
1167
Map <String , Object > sampleDomainMap = dyaml .load (sampleDomainInputStream );
1147
1168
sampleDomainInputStream .close ();
1148
1169
@@ -1183,9 +1204,9 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
1183
1204
domainMap .put ("logHome" , "/shared/logs/" + domainUid );
1184
1205
if (!domainMap .containsKey ("domainHomeImageBase" )) {
1185
1206
domainMap .put ("domainHome" , "/shared/domains/" + domainUid );
1186
- domainMap .put (
1187
- "createDomainFilesDir" ,
1188
- BaseTest .getProjectRoot () + "/integration-tests/src/test/resources/domain-home-on-pv" );
1207
+ /* domainMap.put(
1208
+ "createDomainFilesDir",
1209
+ BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/domain-home-on-pv"); */
1189
1210
domainMap .put ("image" , imageName + ":" + imageTag );
1190
1211
}
1191
1212
@@ -1348,14 +1369,15 @@ private void gitCloneDockerImagesSample(Map domainMap) throws Exception {
1348
1369
+ " "
1349
1370
+ result .stdout ());
1350
1371
}
1351
- // copy script to cloned location
1352
- Files .copy (
1353
- new File (
1354
- BaseTest .getProjectRoot ()
1355
- + "/integration-tests/src/test/resources/domain-home-on-image/create-wls-domain.py" )
1356
- .toPath (),
1357
- new File (domainHomeImageBuildPath + "/container-scripts/create-wls-domain.py" ).toPath (),
1358
- StandardCopyOption .REPLACE_EXISTING );
1372
+
1373
+ // copy create domain py script to cloned location
1374
+ if (domainMap .containsKey ("createDomainPyScript" )) {
1375
+ Files .copy (
1376
+ new File (BaseTest .getProjectRoot () + "/" + domainMap .get ("createDomainPyScript" ))
1377
+ .toPath (),
1378
+ new File (domainHomeImageBuildPath + "/container-scripts/create-wls-domain.py" ).toPath (),
1379
+ StandardCopyOption .REPLACE_EXISTING );
1380
+ }
1359
1381
}
1360
1382
}
1361
1383
0 commit comments