Esempio n. 1
0
    def test_07_git_enable_revision(self):
        target_dir = tempfile.mkdtemp()
        repo = git.git_create_tmp_repo()
        rev = git.git_code_version(repo)

        dest_dir = git.git_enable_revision(target_dir, repo, rev)

        self.assertEquals(rev, os.path.basename(dest_dir))
Esempio n. 2
0
    def test_07_git_enable_revision(self):
        target_dir = tempfile.mkdtemp()
        repo = git.git_create_tmp_repo()
        rev = git.git_code_version(repo) 

        dest_dir = git.git_enable_revision(target_dir, repo, rev)

        self.assertEquals(rev, os.path.basename(dest_dir))
Esempio n. 3
0
    def test_05_git_code_version(self):
        repo = git.git_create_tmp_repo() 
        code_version = git.git_code_version(repo)

        # git_code_version should be something like '68ed1b0'
        pattern = "^[a-z0-9]{7,7}$"
        self.assertIsNot(None, re.match(pattern, code_version), 
            "code_version '%s' does not match '%s'" % (code_version, pattern))
Esempio n. 4
0
    def on_git_push(self):
        config = self._configuration_get()

        repo = git.DEFAULT_CODE_REPO
        revision = git.git_code_version(repo)
        codeVersionId = "git-%s" % revision

        config.codeVersions[codeVersionId] = CodeVersion(id=codeVersionId,
                                                         filename=revision,
                                                         atype="git",
                                                         description=git.git_last_description(repo))

        self._configuration_set(config)
Esempio n. 5
0
    def git_push_hook(self, kwargs):
        try:
            exp_params = []
            check_arguments(exp_params, kwargs)
        except Exception as ex:
            return HttpErrorResponse("%s" % ex)

        repo = git.DEFAULT_CODE_REPO
        revision = git.git_code_version(repo)

        for service_id in self.httpsserver.instances:
            if service_id != 0:
                self.httpsserver.instances[service_id].on_git_push()

        return HttpJsonResponse('code version: git-%s' % revision)
Esempio n. 6
0
  def git_push_hook(self, kwargs):
    if len(kwargs) != 0:
      return HttpErrorResponse(ManagerException(ManagerException.E_ARGS_UNEXPECTED, kwargs.keys()).message)

    config = self._configuration_get()

    repo = git.DEFAULT_CODE_REPO
    codeVersionId = git.git_code_version(repo)

    config.codeVersions[codeVersionId] = CodeVersion(id=codeVersionId, 
                                                     filename=codeVersionId, 
                                                     atype="git", 
                                                     description=git.git_last_description(repo))

    self._configuration_set(config)
    return HttpJsonResponse({ 'codeVersionId': codeVersionId })
Esempio n. 7
0
    def git_push_hook(self, kwargs):
        if len(kwargs) != 0:
            return HttpErrorResponse(
                ManagerException(ManagerException.E_ARGS_UNEXPECTED,
                                 kwargs.keys()).message)

        config = self._configuration_get()

        repo = git.DEFAULT_CODE_REPO
        codeVersionId = git.git_code_version(repo)

        config.codeVersions[codeVersionId] = CodeVersion(
            id=codeVersionId,
            filename=codeVersionId,
            atype="git",
            description=git.git_last_description(repo))

        self._configuration_set(config)
        return HttpJsonResponse({'codeVersionId': codeVersionId})
Esempio n. 8
0
    def test_05_git_code_version(self):
        repo = git.git_create_tmp_repo()
        code_version = git.git_code_version(repo)

        # git_code_version should something like '68ed1b0'
        self.assertIsNot(None, re.match("^[a-z0-9]{7,7}$", code_version))
Esempio n. 9
0
    def test_05_git_code_version(self):
        repo = git.git_create_tmp_repo() 
        code_version = git.git_code_version(repo)

        # git_code_version should something like '68ed1b0'
        self.assertIsNot(None, re.match("^[a-z0-9]{7,7}$", code_version))