Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildstream
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
BuildStream
buildstream
Commits
48184cf2
Commit
48184cf2
authored
6 years ago
by
Tristan Maat
Browse files
Options
Downloads
Patches
Plain Diff
buildelement.py: Only display one activity message (
#507
)
parent
48916b8a
No related branches found
No related tags found
No related merge requests found
Pipeline
#26628880
passed
6 years ago
Stage: prepare
Stage: test
Stage: post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildstream/buildelement.py
+13
-12
13 additions, 12 deletions
buildstream/buildelement.py
with
13 additions
and
12 deletions
buildstream/buildelement.py
+
13
−
12
View file @
48184cf2
#
# Copyright (C) 2016 Codethink Limited
# Copyright (C) 2018 Bloomberg Finance LP
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
...
...
@@ -204,8 +205,9 @@ class BuildElement(Element):
def
prepare
(
self
,
sandbox
):
commands
=
self
.
__commands
[
'
configure-commands
'
]
if
commands
:
for
cmd
in
commands
:
self
.
__run_command
(
sandbox
,
cmd
,
'
configure-commands
'
)
with
self
.
timed_activity
(
"
Running configure-commands
"
):
for
cmd
in
commands
:
self
.
__run_command
(
sandbox
,
cmd
,
'
configure-commands
'
)
def
generate_script
(
self
):
script
=
""
...
...
@@ -231,13 +233,12 @@ class BuildElement(Element):
return
commands
def
__run_command
(
self
,
sandbox
,
cmd
,
cmd_name
):
with
self
.
timed_activity
(
"
Running {}
"
.
format
(
cmd_name
)):
self
.
status
(
"
Running {}
"
.
format
(
cmd_name
),
detail
=
cmd
)
# Note the -e switch to 'sh' means to exit with an error
# if any untested command fails.
#
exitcode
=
sandbox
.
run
([
'
sh
'
,
'
-c
'
,
'
-e
'
,
cmd
+
'
\n
'
],
SandboxFlags
.
ROOT_READ_ONLY
)
if
exitcode
!=
0
:
raise
ElementError
(
"
Command
'
{}
'
failed with exitcode {}
"
.
format
(
cmd
,
exitcode
))
self
.
status
(
"
Running {}
"
.
format
(
cmd_name
),
detail
=
cmd
)
# Note the -e switch to 'sh' means to exit with an error
# if any untested command fails.
#
exitcode
=
sandbox
.
run
([
'
sh
'
,
'
-c
'
,
'
-e
'
,
cmd
+
'
\n
'
],
SandboxFlags
.
ROOT_READ_ONLY
)
if
exitcode
!=
0
:
raise
ElementError
(
"
Command
'
{}
'
failed with exitcode {}
"
.
format
(
cmd
,
exitcode
))
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