SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
be5122f3
Commit
be5122f3
authored
1 year ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
add try catch to git repo creation
parent
071f6671
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!42
Add git integration to server
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost_django/production/management/commands/advance_git_repos.py
+41
-13
41 additions, 13 deletions
...jango/production/management/commands/advance_git_repos.py
with
41 additions
and
13 deletions
scipost_django/production/management/commands/advance_git_repos.py
+
41
−
13
View file @
be5122f3
...
...
@@ -475,28 +475,56 @@ class Command(BaseCommand):
# Create the repos
repos_to_be_created
=
repos
.
filter
(
status
=
PROOFS_REPO_UNINITIALIZED
)
for
repo
in
repos_to_be_created
:
self
.
_create_git_repo
(
repo
)
repo
.
status
=
PROOFS_REPO_CREATED
repo
.
save
()
try
:
self
.
_create_git_repo
(
repo
)
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
repos_to_be_templated
=
repos
.
filter
(
status
=
PROOFS_REPO_CREATED
)
for
repo
in
repos_to_be_templated
:
self
.
_copy_pure_templates
(
repo
)
repo
.
status
=
PROOFS_REPO_TEMPLATE_ONLY
repo
.
save
()
try
:
self
.
_copy_pure_templates
(
repo
)
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
repos_to_be_formatted
=
repos
.
filter
(
status
=
PROOFS_REPO_TEMPLATE_ONLY
)
for
repo
in
repos_to_be_formatted
:
self
.
_format_skeleton
(
repo
)
repo
.
status
=
PROOFS_REPO_TEMPLATE_FORMATTED
repo
.
save
()
try
:
self
.
_format_skeleton
(
repo
)
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
repos_to_be_copied
=
repos
.
filter
(
status
=
PROOFS_REPO_TEMPLATE_FORMATTED
)
for
repo
in
repos_to_be_copied
:
if
"
arxiv.org
"
in
repo
.
stream
.
submission
.
preprint
.
url
:
self
.
_copy_arxiv_source_files
(
repo
)
repo
.
status
=
PROOFS_REPO_PRODUCTION_READY
repo
.
save
()
try
:
if
"
arxiv.org
"
in
repo
.
stream
.
submission
.
preprint
.
url
:
self
.
_copy_arxiv_source_files
(
repo
)
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
}
"
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment