Exemple #1
0
 def build(self):
     self.trigger('source-build-before')
     #ret=run.script_execute(self.script,[],self.cwd)
     if not self.host or self.host == "127.0.0.1":
         stdout,stderr=run.execute_helper(self.script,[],self.cwd)
     else:
         client = ssh.SSHUtil(self.host,self.username,self.password)
         stdout,stderr=client.execute_lines([self.script],cwd=self.cwd)
     self.trigger('source-build-after')
     if stderr:
         LOG.error(stderr)
     if stdout:
         LOG.log(stdout)
     return stdout,stderr 
Exemple #2
0
 def package(self,cwd,env,host=None,user=None,password=None):
     cmd=['file_name="'+ self.target % env + '"']
     self.trigger('result-package-before')
     if not host or host == "127.0.0.1":
         stdout,stderr=run.execute_helper(self.script,cmd,cwd=cwd)
     else:
         client = ssh.SSHUtil(host,user,password)
         stdout,stderr=client.execute_lines([" ".join([self.script] + cmd)],cwd=cwd)
     self.trigger('result-package-after')
     if stderr:
         LOG.error(stderr)
     if stdout:
         LOG.log(stdout)
     return stdout,stderr
Exemple #3
0
 def checkout(self,cfg,cwd,version,host,user,password):
     cmd=['svn' , 'checkout',
         cfg.url if not version else "%s@%s" % (cfg.url,version),cwd,
          '--username',cfg.username,
          '--password',cfg.password,
          '--non-interactive','--no-auth-cache' ]
     if not host or host == "127.0.0.1":
         stdout,stderr=run.simple_execute(cmd,return_stderr=True)
     else:
         client=ssh.SSHUtil(host,user,password)
         stdout,stderr=client.execute_lines(["echo 'rm -rf %s'" % cwd," ".join(cmd)],cwd=None)
         if stderr:
             LOG.error(stderr)
         if stdout:
             LOG.log(stdout)
     return stdout,stderr