buildframework/helium/tools/release/scm_release.ant.xml
changeset 645 b8d81fa19e7d
parent 628 7c4a911dc066
equal deleted inserted replaced
643:27cf35f95864 645:b8d81fa19e7d
    38           * deconfigure
    38           * deconfigure
    39           * rebaseline
    39           * rebaseline
    40         * update
    40         * update
    41         * maintain the work area
    41         * maintain the work area
    42      -->
    42      -->
    43     <target name="release-work-area">
    43     <target name="release-work-area" if="internal.ccm.enabled">
    44         <mkdir dir="${release.log.dir}" />
    44         <mkdir dir="${release.log.dir}" />
    45         <hlm:record name="${release.log.dir}/${build.id}_release_work_area.log" action="start"/>
    45         <hlm:record name="${release.log.dir}/${build.id}_release_work_area.log" action="start"/>
    46         <runtarget target="get-ccm-password"/>
    46         <runtarget target="get-ccm-password"/>
    47         <runtarget target="ccm-prepare-input"/>
    47         <runtarget target="ccm-prepare-input"/>
    48         
    48         
    59 import os.path
    59 import os.path
    60 
    60 
    61 # enabling logging
    61 # enabling logging
    62 logging.basicConfig(level=logging.INFO)
    62 logging.basicConfig(level=logging.INFO)
    63 
    63 
    64 builder = None           
    64 configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
    65 configSet = configBuilder.getConfiguration()
       
    66 password = ant.get_property(r'${ccm.user.password}')
       
    67 builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
    65 try:
    68 try:
    66     configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
    67     configSet = configBuilder.getConfiguration()
       
    68     password = ant.get_property(r'${ccm.user.password}')
       
    69     builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
       
    70     builder.extract_release_data(r'${release.log.dir}/${build.id}_releasable.xml')
    69     builder.extract_release_data(r'${release.log.dir}/${build.id}_releasable.xml')
       
    70 finally:
    71     builder.close()
    71     builder.close()
    72 except Exception, e:
       
    73     print "ERROR: error found during preparation phase:" 
       
    74     for l in traceback.format_exc().splitlines(False):
       
    75         print "ERROR: %s" % l
       
    76     print "ERROR: this is a critical error, build will fail now:"
       
    77     for l in str(e).splitlines(False):
       
    78         print "ERROR: %s" % l
       
    79     if builder != None:
       
    80         builder.close()
       
    81     sys.exit(-1)
       
    82 sys.exit(0)
       
    83                 </hlm:python>
    72                 </hlm:python>
    84             </try>
    73             </try>
    85             <finally>
    74             <finally>
    86                 <hlm:record name="${release.log.dir}/${build.id}_release_work_area.log" action="stop"/>
    75                 <hlm:record name="${release.log.dir}/${build.id}_release_work_area.log" action="stop"/>
    87                 <hlm:assertFileExists file="${release.log.dir}/${build.id}_release_work_area.log" />
    76                 <hlm:assertFileExists file="${release.log.dir}/${build.id}_release_work_area.log" />