@@ -804,8 +804,8 @@ private void createPV() throws Exception {
804
804
InputStream pv_is =
805
805
new FileInputStream (
806
806
new File (
807
- BaseTest .getProjectRoot ()
808
- + "/kubernetes/ samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml" ));
807
+ BaseTest .getResultDir ()
808
+ + "/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml" ));
809
809
pvMap = yaml .load (pv_is );
810
810
pv_is .close ();
811
811
pvMap .put ("domainUID" , domainUid );
@@ -876,21 +876,33 @@ private void generateInputYaml() throws Exception {
876
876
}
877
877
878
878
private void callCreateDomainScript (String outputDir ) throws Exception {
879
- StringBuffer createDomainScriptCmd = new StringBuffer (BaseTest .getProjectRoot ());
880
879
880
+ // copy create domain py script
881
+ if (domainMap .containsKey ("createDomainPyScript" )) {
882
+ Files .copy (
883
+ new File (BaseTest .getProjectRoot () + "/" + domainMap .get ("createDomainPyScript" ))
884
+ .toPath (),
885
+ new File (
886
+ BaseTest .getResultDir ()
887
+ + "/samples/scripts/create-weblogic-domain/domain-home-on-pv/wlst/create-domain.py" )
888
+ .toPath (),
889
+ StandardCopyOption .REPLACE_EXISTING );
890
+ }
891
+
892
+ StringBuffer createDomainScriptCmd = new StringBuffer (BaseTest .getResultDir ());
881
893
if (domainMap .containsKey ("domainHomeImageBase" )) {
882
894
// clone docker sample from github
883
895
gitCloneDockerImagesSample (domainMap );
884
896
createDomainScriptCmd
885
897
.append (
886
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh -u " )
898
+ "/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh -u " )
887
899
.append (BaseTest .getUsername ())
888
900
.append (" -p " )
889
901
.append (BaseTest .getPassword ())
890
902
.append (" -k -i " );
891
903
} else {
892
904
createDomainScriptCmd .append (
893
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh -v -i " );
905
+ "/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh -v -i " );
894
906
}
895
907
createDomainScriptCmd .append (generatedInputYamlFile );
896
908
@@ -1090,22 +1102,24 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
1090
1102
this .userProjectsDir = BaseTest .getUserProjectsDir ();
1091
1103
this .projectRoot = BaseTest .getProjectRoot ();
1092
1104
1105
+ // copy samples to RESULT_DIR
1106
+ TestUtils .exec (
1107
+ "cp -r " + BaseTest .getProjectRoot () + "/kubernetes/samples " + BaseTest .getResultDir ());
1108
+
1093
1109
domainMap .put ("domainName" , domainMap .get ("domainUID" ));
1094
1110
1095
1111
// read sample domain inputs
1096
1112
String sampleDomainInputsFile =
1097
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml" ;
1113
+ "/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml" ;
1098
1114
if (domainMap .containsKey ("domainHomeImageBase" )) {
1099
1115
sampleDomainInputsFile =
1100
- "/kubernetes/ samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml" ;
1116
+ "/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml" ;
1101
1117
}
1102
1118
Yaml dyaml = new Yaml ();
1103
1119
InputStream sampleDomainInputStream =
1104
- new FileInputStream (new File (BaseTest .getProjectRoot () + sampleDomainInputsFile ));
1120
+ new FileInputStream (new File (BaseTest .getResultDir () + sampleDomainInputsFile ));
1105
1121
logger .info (
1106
- "loading domain inputs template file "
1107
- + BaseTest .getProjectRoot ()
1108
- + sampleDomainInputsFile );
1122
+ "loading domain inputs template file " + BaseTest .getResultDir () + sampleDomainInputsFile );
1109
1123
Map <String , Object > sampleDomainMap = dyaml .load (sampleDomainInputStream );
1110
1124
sampleDomainInputStream .close ();
1111
1125
@@ -1146,9 +1160,9 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
1146
1160
domainMap .put ("logHome" , "/shared/logs/" + domainUid );
1147
1161
if (!domainMap .containsKey ("domainHomeImageBase" )) {
1148
1162
domainMap .put ("domainHome" , "/shared/domains/" + domainUid );
1149
- domainMap .put (
1150
- "createDomainFilesDir" ,
1151
- BaseTest .getProjectRoot () + "/integration-tests/src/test/resources/domain-home-on-pv" );
1163
+ /* domainMap.put(
1164
+ "createDomainFilesDir",
1165
+ BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/domain-home-on-pv"); */
1152
1166
domainMap .put ("image" , imageName + ":" + imageTag );
1153
1167
}
1154
1168
0 commit comments