Subversion Repositories DevTools

Rev

Rev 7033 | Rev 7169 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7033 Rev 7155
Line 252... Line 252...
252
                                        //    Notify the user requesting the build
252
                                        //    Notify the user requesting the build
253
                                        //        Build Failure emails have already been sent
253
                                        //        Build Failure emails have already been sent
254
                                        //
254
                                        //
255
                                        mLogger.info("run completing test build on " + mReporting.packageName + mReporting.packageExtension);
255
                                        mLogger.info("run completing test build on " + mReporting.packageName + mReporting.packageExtension);
256
                                        mPhase.setPhase("Report Test Build Complete");
256
                                        mPhase.setPhase("Report Test Build Complete");
257
                                        Package p = mRippleEngine.findPackage(mReporting.packageName + mReporting.packageExtension);
-
 
258
                                        if (p != ReleaseManager.NULL_PACKAGE)
-
 
259
                                        {
-
 
260
                                            mLogger.error("run calling p.completeTestBuild");                      
-
 
261
                                            p.completeTestBuild(mRippleEngine, mReporting.isFullyPublished);
257
                                        completeTestBuild(mRippleEngine, mReporting.isFullyPublished);
262
                                        }
-
 
263
 
258
 
264
                                        //
259
                                        //
265
                                        //  Determine the total time taken by the build
260
                                        //  Determine the total time taken by the build
266
                                        //      Done as late a possible in the process
261
                                        //      Done as late a possible in the process
267
                                        //      Does not include planning time
262
                                        //      Does not include planning time
Line 847... Line 842...
847
                "Build Standards : " + indent + buildStandards;
842
                "Build Standards : " + indent + buildStandards;
848
 
843
 
849
        mailBody += "<p><hr>";
844
        mailBody += "<p><hr>";
850
        try
845
        try
851
        {
846
        {
852
            Smtpsend.send( rippleEngine.getMailServer(),           // mailServer
847
            Smtpsend.send( rippleEngine.getMailServer(),    // mailServer
853
                    rippleEngine.getMailSender(),           // source
848
                    rippleEngine.getMailSender(),           // source
854
                    emailTo,                            // target - send to package owners, or myself
849
                    emailTo,                                // target - send to package owners, or myself
855
                    rippleEngine.getMailSender(),           // cc
850
                    rippleEngine.getMailSender(),           // cc
856
                    null,                               // bcc
851
                    null,                                   // bcc
857
                    subject,                            // subject
852
                    subject,                                // subject
858
                    mailBody,                           // body
853
                    mailBody,                               // body
859
                    null                                // attachment
854
                    null                                    // attachment
860
                    );
855
                    );
861
        }
856
        }
862
        catch( Exception e )
857
        catch( Exception e )
863
        {
858
        {
864
            mLogger.warn("Email Failure: emailPostBuild:" + e.getMessage());
859
            mLogger.warn("Email Failure: emailPostBuild:" + e.getMessage());
865
        }
860
        }
866
        mLogger.debug("emailPostBuild. Returning");
861
        mLogger.debug("emailPostBuild. Returning");
867
    }
862
    }
-
 
863
    
-
 
864
    /**
-
 
865
     * End of Processing for a Test Build
-
 
866
     *     - sends email notification
-
 
867
     *     - marks the instruction complete in the database
-
 
868
     */
-
 
869
    public void completeTestBuild(RippleEngine rippleEngine, boolean success) throws SQLException, Exception
-
 
870
    {
-
 
871
        mLogger.debug("completeTestBuild");
-
 
872
 
-
 
873
        if (!mReporting.isaTestBuild)
-
 
874
        {
-
 
875
            mLogger.info("completeTestBuild. Not Build Instruction");
-
 
876
            return;
-
 
877
        }
-
 
878
 
-
 
879
        //  Email Subject
-
 
880
        String subject = (success ? "TEST BUILD COMPLETED SUCCESSFULLY" : "TEST BUILD FAILED") 
-
 
881
                + " on package "
-
 
882
                + mReporting.packageName +  mReporting.packageExtension;
-
 
883
       
-
 
884
        //  Cleanup the dependency string
-
 
885
        //      Expecting: 'junit','3.7.0.cots';'ant-ejbdoclet','1.0000.cr'
-
 
886
        String indent = "<br>&nbsp;&nbsp;&nbsp;&nbsp;";
-
 
887
        String depends = mReporting.packageDepends.replace("','", " ");
-
 
888
        depends = depends.replace("';'",indent);
-
 
889
        depends = depends.replace("'","");
-
 
890
 
-
 
891
        //  Cleanup the build standard string
-
 
892
        //      Expecting win32: jats all;linux_i386: jats prod
-
 
893
        String buildStandards = mReporting.packageBuildInfo;
-
 
894
        buildStandards = buildStandards.replace(";",indent);
-
 
895
 
-
 
896
        // Email Body
-
 
897
        String mailBody = "";
-
 
898
        if ( !success )
-
 
899
        {
-
 
900
            mailBody += "Test build issues are identified in preceding build failure email.<p>"; 
-
 
901
        }
-
 
902
        mailBody += "Release: " + rippleEngine.mBaselineName + "<br>" 
-
 
903
                  + "Package: " + mReporting.packageName +  mReporting.packageExtension + "<br>" 
-
 
904
                  + "Rm Ref: " + CreateUrls.generateRmUrl(mReporting.rtagId, mReporting.packageVersionId) + "<br>" 
-
 
905
                  + "VcsTag: " + mReporting.vcsTag + "<br>"
-
 
906
                  + "Dependencies : " + indent + depends + "<br>"
-
 
907
                  + "Build Standards : " + indent + buildStandards;
-
 
908
       
-
 
909
        mailBody += "<p><hr>";
-
 
910
        try
-
 
911
        {
-
 
912
            mLogger.error("completeTestBuildEmail Server: {}", rippleEngine.getMailServer());
-
 
913
            mLogger.error("completeTestBuildEmail Sender: {}", rippleEngine.getMailSender());
-
 
914
            mLogger.error("completeTestBuildEmail Target: {}", mReporting.packageOwners);
-
 
915
 
-
 
916
            Smtpsend.send(rippleEngine.getMailServer(),     // mailServer
-
 
917
                    rippleEngine.getMailSender(),           // source
-
 
918
                    mReporting.packageOwners,               // target
-
 
919
                    rippleEngine.getMailSender(),           // cc
-
 
920
                    null,                                   // bcc
-
 
921
                    subject,                                // subject
-
 
922
                    mailBody,                               // body
-
 
923
                    null                                    // attachment
-
 
924
            );
-
 
925
        } catch (Exception e)
-
 
926
        {
-
 
927
            mLogger.warn("Email Failure: completeTestBuild:{}", e.getMessage());
-
 
928
        }
-
 
929
 
-
 
930
        // Update the Release Manager Database
-
 
931
        mReleaseManager.markDaemonInstCompleted(mReporting.testBuildId);
-
 
932
        mLogger.error("completeTest. Returning");
-
 
933
    }
-
 
934
    
868
 
935
 
869
    /**returns 'M'
936
    /**returns 'M'
870
     */
937
     */
871
    protected char getMode()
938
    protected char getMode()
872
    {
939
    {