class RemoveIOSProvisioningProfile(OperationBase):
    def __init__(self, *args, **kwargs):
        super(RemoveIOSProvisioningProfile, self).__init__(*args, **kwargs)
        self.downloader = ReplaceFromUrl(*args, **kwargs)

    @classmethod
    def get_arg_descriptors(cls):
        return [
            ArgumentDescriptor("Resource",
                               "The provistioning profile resource", "text")
        ]

    def set_args(self, Resource):
        self.kwargs["Resource"] = self.provistioning_profile = Resource

    def run(self):
        if '*' in self.provistioning_profile:
            target, profile_type = self.provistioning_profile.split('*')
            rm_profile_by_app_id(target, profile_type)
        else:
            self.downloader.set_args(self.provistioning_profile,
                                     '/tmp/temp.mobileprovision')
            self.downloader.run()
            rm_profile_like_on_path('/tmp/temp.mobileprovision',
                                    CommandArgsProxy())
            os.unlink('/tmp/temp.mobileprovision')
            self.result = True
Beispiel #2
0
class RemoveIOSProvisioningProfile(OperationBase):

    def __init__(self, *args, **kwargs):
        super(RemoveIOSProvisioningProfile, self).__init__(*args, **kwargs)
        self.downloader = ReplaceFromUrl(*args, **kwargs)

    @classmethod
    def get_arg_descriptors(cls):
        return [
            ArgumentDescriptor(
                "Resource",
                "The provistioning profile resource",
                "text")]

    def set_args(self, Resource):
        self.kwargs["Resource"] = self.provistioning_profile = Resource

    def run(self):
        if '*' in self.provistioning_profile:
            target, profile_type = self.provistioning_profile.split('*')
            rm_profile_by_app_id(target, profile_type)
        else:
            self.downloader.set_args(
                self.provistioning_profile,
                '/tmp/temp.mobileprovision')
            self.downloader.run()
            rm_profile_like_on_path(
                '/tmp/temp.mobileprovision', CommandArgsProxy())
            os.unlink('/tmp/temp.mobileprovision')
            self.result = True
Beispiel #3
0
class InstallIOSCertificate(OperationBase):

    def __init__(self, *args, **kwargs):
        super(InstallIOSCertificate, self).__init__(*args, **kwargs)
        self.result = ''
        self.downloader = ReplaceFromUrl(*args, **kwargs)

    @classmethod
    def get_arg_descriptors(cls):
        return [
            ArgumentDescriptor(
                "Resource",
                "The Developer Certificate resource",
                "text"),
            ArgumentDescriptor(
                "Password",
                "Password to unlock the certificate",
                "text")]

    def set_args(self, Resource, Password):
        self.kwargs["Resource"] = self.cert = Resource
        self.kwargs["Password"] = self.password = Password

    def run(self):
        self.downloader.set_args(self.cert, '/tmp/temp.p12')
        self.downloader.run()
        add_cert('/tmp/temp.p12', CommandArgsProxy(passwd=self.password))
        os.unlink('/tmp/temp.p12')
Beispiel #4
0
class AddIOSProvisioningProfile(OperationBase):

    def __init__(self, *args, **kwargs):
        super(AddIOSProvisioningProfile, self).__init__(*args, **kwargs)
        self.provistioning_profile = None
        self.downloader = ReplaceFromUrl(*args, **kwargs)

    @classmethod
    def get_arg_descriptors(cls):
        return [
            ArgumentDescriptor(
                "Resource",
                "The provisioning profile resource",
                "text")]

    def set_args(self, Resource):
        self.kwargs["Resource"] = self.provistioning_profile = Resource

    def run(self):
        profile_item = self.provistioning_profile

        def is_file():
            downloader_prefixes = ['file://', 'http://', 'ftp://', 'https://']
            for dp in downloader_prefixes:
                if profile_item.startswith(dp):
                    return True
            return False
        if is_file():
            self.downloader.set_args(profile_item, '/tmp/temp.mobileprovision')
            self.downloader.run()
            add_profile('/tmp/temp.mobileprovision', CommandArgsProxy())
            os.unlink('/tmp/temp.mobileprovision')
            self.result = True
        else:
            path, target, profile_type = profile_item.split("*")
            if not os.path.isabs(path):
                from urlparse import urlparse
                root = urlparse(self.executor.resources_root)
                path = os.path.join(root.path, path)
            profile_infos = ls_profiles(path, target, profile_type)
            for info in profile_infos:
                self.downloader.set_args(
                    'file://' + info['path'],
                    '/tmp/temp.mobileprovision')
                self.downloader.run()
                add_profile('/tmp/temp.mobileprovision', CommandArgsProxy())
                os.unlink('/tmp/temp.mobileprovision')
class AddIOSProvisioningProfile(OperationBase):
    def __init__(self, *args, **kwargs):
        super(AddIOSProvisioningProfile, self).__init__(*args, **kwargs)
        self.provistioning_profile = None
        self.downloader = ReplaceFromUrl(*args, **kwargs)

    @classmethod
    def get_arg_descriptors(cls):
        return [
            ArgumentDescriptor("Resource", "The provisioning profile resource",
                               "text")
        ]

    def set_args(self, Resource):
        self.kwargs["Resource"] = self.provistioning_profile = Resource

    def run(self):
        profile_item = self.provistioning_profile

        def is_file():
            downloader_prefixes = ['file://', 'http://', 'ftp://', 'https://']
            for dp in downloader_prefixes:
                if profile_item.startswith(dp):
                    return True
            return False

        if is_file():
            self.downloader.set_args(profile_item, '/tmp/temp.mobileprovision')
            self.downloader.run()
            add_profile('/tmp/temp.mobileprovision', CommandArgsProxy())
            os.unlink('/tmp/temp.mobileprovision')
            self.result = True
        else:
            path, target, profile_type = profile_item.split("*")
            if not os.path.isabs(path):
                from urlparse import urlparse
                root = urlparse(self.executor.resources_root)
                path = os.path.join(root.path, path)
            profile_infos = ls_profiles(path, target, profile_type)
            for info in profile_infos:
                self.downloader.set_args('file://' + info['path'],
                                         '/tmp/temp.mobileprovision')
                self.downloader.run()
                add_profile('/tmp/temp.mobileprovision', CommandArgsProxy())
                os.unlink('/tmp/temp.mobileprovision')
class InstallIOSCertificate(OperationBase):
    def __init__(self, *args, **kwargs):
        super(InstallIOSCertificate, self).__init__(*args, **kwargs)
        self.result = ''
        self.downloader = ReplaceFromUrl(*args, **kwargs)

    @classmethod
    def get_arg_descriptors(cls):
        return [
            ArgumentDescriptor("Resource",
                               "The Developer Certificate resource", "text"),
            ArgumentDescriptor("Password",
                               "Password to unlock the certificate", "text")
        ]

    def set_args(self, Resource, Password):
        self.kwargs["Resource"] = self.cert = Resource
        self.kwargs["Password"] = self.password = Password

    def run(self):
        self.downloader.set_args(self.cert, '/tmp/temp.p12')
        self.downloader.run()
        add_cert('/tmp/temp.p12', CommandArgsProxy(passwd=self.password))
        os.unlink('/tmp/temp.p12')