Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Managetests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Managetests
Commits
c218b3d8
Commit
c218b3d8
authored
Mar 02, 2019
by
Mattia Rizzolo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always set all the metadata on deployment failure
Signed-off-by:
Mattia Rizzolo
<
mattia@debian.org
>
parent
1d9822b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
managetests/branches.py
managetests/branches.py
+12
-3
No files found.
managetests/branches.py
View file @
c218b3d8
...
@@ -246,7 +246,7 @@ class Branch:
...
@@ -246,7 +246,7 @@ class Branch:
if
not
(
branch
/
"build"
/
"managetests.json"
).
exists
():
if
not
(
branch
/
"build"
/
"managetests.json"
).
exists
():
log
(
"[!] No managetests.json found in the branch!"
)
log
(
"[!] No managetests.json found in the branch!"
)
log
(
"[!] Aborting!"
)
log
(
"[!] Aborting!"
)
return
False
return
self
.
fail_deployment
(
branch
)
shutil
.
copy
(
shutil
.
copy
(
str
(
branch
/
"build"
/
"managetests.json"
),
str
(
branch
/
"build"
/
"managetests.json"
),
...
@@ -259,7 +259,7 @@ class Branch:
...
@@ -259,7 +259,7 @@ class Branch:
if
not
self
.
exec_command
(
cmd
,
build
=
True
):
if
not
self
.
exec_command
(
cmd
,
build
=
True
):
log
(
"[!] Failed to execute build command: %s"
%
" "
.
join
(
cmd
))
log
(
"[!] Failed to execute build command: %s"
%
" "
.
join
(
cmd
))
log
(
"[!] Aborting!"
)
log
(
"[!] Aborting!"
)
return
False
self
.
fail_deployment
(
branch
)
# Check if the branch was successifully built
# Check if the branch was successifully built
popen_args
=
self
.
command_popen_args
(
self
.
config
[
"run"
])
popen_args
=
self
.
command_popen_args
(
self
.
config
[
"run"
])
...
@@ -268,7 +268,7 @@ class Branch:
...
@@ -268,7 +268,7 @@ class Branch:
self
.
update_status
(
"success"
)
self
.
update_status
(
"success"
)
else
:
else
:
log
(
"[!] Warning: build seems to have failed"
)
log
(
"[!] Warning: build seems to have failed"
)
self
.
update_status
(
"failed"
)
self
.
fail_deployment
(
branch
)
self
.
manager
.
details
[
"branches"
][
self
.
name
]
=
self
.
mr
self
.
manager
.
details
[
"branches"
][
self
.
name
]
=
self
.
mr
self
.
manager
.
save_details
()
self
.
manager
.
save_details
()
...
@@ -299,6 +299,15 @@ class Branch:
...
@@ -299,6 +299,15 @@ class Branch:
pass
pass
self
.
manager
.
save_details
()
self
.
manager
.
save_details
()
def
fail_deployment
(
self
,
branch
):
self
.
_deploying
=
False
self
.
update_status
(
'failed'
)
self
.
manager
.
details
[
"branches"
][
self
.
name
]
=
self
.
mr
self
.
manager
.
save_details
()
# Create the built file
(
branch
/
"built"
).
touch
()
return
False
def
update_status
(
self
,
state
,
log
=
True
):
def
update_status
(
self
,
state
,
log
=
True
):
"""Update the commit status"""
"""Update the commit status"""
# Don't update status hooks on development instances
# Don't update status hooks on development instances
...
...
Write
Preview
Markdown
is supported
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