예제 #1
0
 def test_set_and_get_postactivate_hook(self):
   before = project.get_by_id(self.project_id)
   eq_(before['post_activate_hook'], None, "GUARD: venv dir set at start")
   hook = 'helios deploy before_activation'
   project.set_post_activate_hook(self.project_id, hook)
   after = project.get_by_id(self.project_id)
   eq_(after['post_activate_hook'], hook)
예제 #2
0
 def test_set_and_get_venv_dir(self):
   """Can set and get the venv dir for a project
   """
   before = project.get_by_id(self.project_id)
   eq_(before['venv_target_dir'], None, "GUARD: venv dir set at start")
   venv_dir = '/opt/outland/app/'
   project.set_venv_dir(self.project_id, venv_dir)
   after = project.get_by_id(self.project_id)
   eq_(after['venv_target_dir'], venv_dir)
예제 #3
0
 def test_set_and_get_deploy_dir(self):
   """Can set and get the deploy dir for a project
   """
   before = project.get_by_id(self.project_id)
   eq_(before['deploy_target_dir'], None, "GUARD: Deploy dir set at start")
   deploy_dir = '/opt/outland/app/'
   project.set_deploy_dir(self.project_id, deploy_dir)
   after = project.get_by_id(self.project_id)
   eq_(after['deploy_target_dir'], deploy_dir)
예제 #4
0
 def setup_class(cls):
   '''Load data and record expected results
   '''
   with gus.config.get_db_conn().cursor() as c:
     c.execute("TRUNCATE TABLE projects CASCADE")
   cls.expected_id_list = []
   cls.expected_id_list.append(project.create_or_get('foo'))
   cls.expected_id_list.append(project.create_or_get('bar'))
   cls.expected_id_list.append(project.create_or_get('baz'))
   cls.expected_object_list = [project.get_by_id(pid)
       for pid in cls.expected_id_list]
예제 #5
0
파일: deploy.py 프로젝트: saltmine/Gus
  def __init__(self, release_candidate_id, chef_api=None,
      deploy_user='******'):
    self.chef_api = chef_api
    self.chef_app_prefs = None
    self.deploy_user = deploy_user  # TODO: get this from the project model

    # turn app:app_rev into tarball url
    self.rc = release_candidate.get_by_id(release_candidate_id)
    self.project = project.get_by_id(self.rc['project_id'])
    self.lock = Lock()
    self.nodes = []
    self.code_dir = None
    self.venv_dir = None
예제 #6
0
 def test_get_by_id(self):
   '''Can look up a project by project_id
   '''
   actual = project.get_by_id(self.project_id)
   eq_(actual['project_name'], self.project_name)