def __init__(self, *args, **kwargs):
        """
        TODO: need to come up with a way to resolve variables used inside the profile
                Best way to do this i think is to pull all available variables form the xlr context and match the
                dictonary's values against them
        :param args:
        :param kwargs:
        :return:
        """

        # pull in the xlrelease apis
        self.__releaseApi = XLReleaseServiceHolder.getReleaseApi()
        self.__repositoryService = XLReleaseServiceHolder.getRepositoryService(
        )
        self.__taskApi = XLReleaseServiceHolder.getTaskApi()
        self.__phaseApi = XLReleaseServiceHolder.getPhaseApi()

        self.__variable_start_regex = re.compile('\$\{', re.IGNORECASE)
        # TODO: replace with {} once testing is done

        self.__variable_start_string = "$<"
        self.__variable_end_string = ">"

        self.store = dict()

        if kwargs.has_key('url'):
            kwargs = self.load_from_url(kwargs['url'])
        elif kwargs.has_key('repoId'):
            kwargs = self.load_profile_from_xlr_repo(kwargs['repoId'])
        elif kwargs.has_key('repoString'):
            kwargs = json.loads(str(kwargs['repoString']))

        self.update(dict(*args, **kwargs))  # use the free update to set keys
    def __init__(self, *args, **kwargs):
        """
        TODO: need to come up with a way to resolve variables used inside the profile
                Best way to do this i think is to pull all available variables form the xlr context and match the
                dictonary's values against them
        :param args:
        :param kwargs:
        :return:
        """

        # pull in the xlrelease apis
        self.__releaseApi = XLReleaseServiceHolder.getReleaseApi()
        self.__repositoryService = XLReleaseServiceHolder.getRepositoryService()
        self.__taskApi = XLReleaseServiceHolder.getTaskApi()
        self.__phaseApi = XLReleaseServiceHolder.getPhaseApi()

        self.__variable_start_regex = re.compile('\$\{', re.IGNORECASE)
        # TODO: replace with {} once testing is done

        self.__variable_start_string = "$<"
        self.__variable_end_string = ">"

        self.store = dict()

        if kwargs.has_key('url'):
            kwargs = self.load_from_url(kwargs['url'])
        elif kwargs.has_key('repoId'):
            kwargs = self.load_profile_from_xlr_repo(kwargs['repoId'])
        elif kwargs.has_key('repoString'):
            kwargs = json.loads(str(kwargs['repoString']))

        self.update(dict(*args, **kwargs))  # use the free update to set keys
    def __init__(self, *args, **kwargs):

         # pull in the xlrelease apis
        self.__releaseApi        = XLReleaseServiceHolder.getReleaseApi()
        self.__repositoryService = XLReleaseServiceHolder.getRepositoryService()
        self.__taskApi           = XLReleaseServiceHolder.getTaskApi()

        self.__variable_start_regex = re.compile('^\$\{', re.IGNORECASE)


        self.store = dict()



        if kwargs.has_key('url'):
            kwargs = self.load_from_url(kwargs['url'])
        elif kwargs.has_key('repoId'):
            kwargs = self.load_profile_from_xlr_repo(kwargs['repoId'])
        elif kwargs.has_key('repoString'):
            kwargs = json.loads(str(kwargs['repoString']))

        self.update(dict(*args, **kwargs))  # use the free update to set keys
Exemple #4
0
import sys

import com.xebialabs.xlrelease.api.XLReleaseServiceHolder as XLReleaseServiceHolder

tagList = tag.split(',')

#get the releaseApi
releaseApi = XLReleaseServiceHolder.getReleaseApi()

# get the object of the current release
this_release = releaseApi.getRelease(release.id)

# extract the tags
tags = this_release.getTags()

# let's print and be merry
print "found these tags for release: %s" % release.id
print tags

#add the tag
for tag in tagList:
    tags.add(str(tag))

    #print and be merry
    print "adding tag: %s to release: %s" % (tag, release.id)

# update the release with the new set of tags
this_release.setTags(tags)

#save the updated release back to xlr
releaseApi.updateRelease(release.id, this_release)
import sys

import com.xebialabs.xlrelease.api.XLReleaseServiceHolder as XLReleaseServiceHolder

tagList = tag.split(',')

#get the releaseApi
releaseApi = XLReleaseServiceHolder.getReleaseApi()

# get the object of the current release
this_release = releaseApi.getRelease(release.id)


# extract the tags
tags = this_release.getTags()

# let's print and be merry
print "found these tags for release: %s" % release.id
print tags


#add the tag
for tag in tagList:
    tags.add(str(tag))

    #print and be merry
    print "adding tag: %s to release: %s" % (tag, release.id)

# update the release with the new set of tags
this_release.setTags(tags)