Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cube-doctor
Commits
6f1788b77a72
Commit
bc72938b
authored
Aug 19, 2021
by
Laurent Peuch
Browse files
fix(regenerate-gitlab-ci): hg add .gitlab-ci.yml if it's generated for the first time
parent
2ce6258785b6
Pipeline
#77521
failed with stage
in 27 seconds
Changes
2
Pipelines
45
Hide whitespace changes
Inline
Side-by-side
cube_doctor/transforms/rebase_all.py
View file @
6f1788b7
...
...
@@ -21,7 +21,7 @@ class RebaseAllMyMRs(NoMRCommand):
logger
.
info
(
f
"see if I can rebase topic '
{
topic
}
'"
)
repo
.
run_command
(
"hg rebase -d 'max(branch('default') and public())' "
f
"-s 'min(topic(
'
{
topic
}
'
))' --dry-run"
f
"-s 'min(topic(
{
topic
}
))' --dry-run"
)
except
subprocess
.
CalledProcessError
as
e
:
if
e
.
returncode
==
255
:
...
...
@@ -35,7 +35,7 @@ class RebaseAllMyMRs(NoMRCommand):
logger
.
warning
(
f
"rebasing topic '
{
topic
}
'..."
)
repo
.
run_command
(
f
"hg rebase -d 'max(branch('default') and public())' -s 'min(topic(
'
{
topic
}
'
))'"
f
"hg rebase -d 'max(branch('default') and public())' -s 'min(topic(
{
topic
}
))'"
)
if
apply
:
repo
.
run_command
(
f
"hg push -r
{
topic
}
"
)
...
...
cube_doctor/transforms/regenerate_gitlab_ci.py
View file @
6f1788b7
...
...
@@ -107,8 +107,10 @@ class RegenerateGitlabCI(Command):
uses_gitlab_ci_extended
=
".gitlab-ci-extended.yml"
in
loaded_gitlab_ci
.
get
(
"include"
,
[]
)
hg_add_gitlab_ci
=
False
else
:
uses_gitlab_ci_extended
=
False
hg_add_gitlab_ci
=
True
new_gitlab_ci
=
jinja2_env
.
from_string
(
GITLAB_CI_TEMPLATE
).
render
(
files_to_include
=
files_to_include
,
...
...
@@ -116,6 +118,9 @@ class RegenerateGitlabCI(Command):
)
repo
.
write_file
(
".gitlab-ci.yml"
,
new_gitlab_ci
)
if
hg_add_gitlab_ci
:
repo
.
run_command
(
"hg add .gitlab-ci.yml"
)
if
"MANIFEST.in"
in
root_files
and
".gitlab-ci.yml"
not
in
repo
.
read_file
(
"MANIFEST.in"
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment