SciPost Code Repository

Skip to content
Snippets Groups Projects

Add git integration to server

Merged George Katsikas requested to merge (removed):master into master
1 file
+ 41
13
Compare changes
  • Side-by-side
  • Inline
@@ -475,28 +475,56 @@ class Command(BaseCommand):
@@ -475,28 +475,56 @@ class Command(BaseCommand):
# Create the repos
# Create the repos
repos_to_be_created = repos.filter(status=PROOFS_REPO_UNINITIALIZED)
repos_to_be_created = repos.filter(status=PROOFS_REPO_UNINITIALIZED)
for repo in repos_to_be_created:
for repo in repos_to_be_created:
self._create_git_repo(repo)
try:
repo.status = PROOFS_REPO_CREATED
self._create_git_repo(repo)
repo.save()
repo.status = PROOFS_REPO_CREATED
 
repo.save()
 
except Exception as e:
 
self.stdout.write(
 
self.style.ERROR(
 
f"Could not create the git repo for {repo.git_path}, error: {e}"
 
)
 
)
# Copy the pure templates
# Copy the pure templates
repos_to_be_templated = repos.filter(status=PROOFS_REPO_CREATED)
repos_to_be_templated = repos.filter(status=PROOFS_REPO_CREATED)
for repo in repos_to_be_templated:
for repo in repos_to_be_templated:
self._copy_pure_templates(repo)
try:
repo.status = PROOFS_REPO_TEMPLATE_ONLY
self._copy_pure_templates(repo)
repo.save()
repo.status = PROOFS_REPO_TEMPLATE_ONLY
 
repo.save()
 
except Exception as e:
 
self.stdout.write(
 
self.style.ERROR(
 
f"Could not copy the pure templates to {repo.git_path}, error: {e}"
 
)
 
)
# Format the skeleton files
# Format the skeleton files
repos_to_be_formatted = repos.filter(status=PROOFS_REPO_TEMPLATE_ONLY)
repos_to_be_formatted = repos.filter(status=PROOFS_REPO_TEMPLATE_ONLY)
for repo in repos_to_be_formatted:
for repo in repos_to_be_formatted:
self._format_skeleton(repo)
try:
repo.status = PROOFS_REPO_TEMPLATE_FORMATTED
self._format_skeleton(repo)
repo.save()
repo.status = PROOFS_REPO_TEMPLATE_FORMATTED
 
repo.save()
 
except Exception as e:
 
self.stdout.write(
 
self.style.ERROR(
 
f"Could not format the skeleton of {repo.git_path}, error: {e}"
 
)
 
)
# Copy the arXiv source files
# Copy the arXiv source files
repos_to_be_copied = repos.filter(status=PROOFS_REPO_TEMPLATE_FORMATTED)
repos_to_be_copied = repos.filter(status=PROOFS_REPO_TEMPLATE_FORMATTED)
for repo in repos_to_be_copied:
for repo in repos_to_be_copied:
if "arxiv.org" in repo.stream.submission.preprint.url:
try:
self._copy_arxiv_source_files(repo)
if "arxiv.org" in repo.stream.submission.preprint.url:
repo.status = PROOFS_REPO_PRODUCTION_READY
self._copy_arxiv_source_files(repo)
repo.save()
repo.status = PROOFS_REPO_PRODUCTION_READY
 
repo.save()
 
except Exception as e:
 
self.stdout.write(
 
self.style.ERROR(
 
f"Could not copy the arXiv source files to {repo.git_path}, error: {e}"
 
)
 
)
Loading