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)
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 })
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})
def test_06_git_last_description(self): repo = git.git_create_tmp_repo() self.assertEquals("Initial commit", git.git_last_description(repo))