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
df7553b5
Commit
df7553b5
authored
6 years ago
by
Mathieu Bridon
Browse files
Options
Downloads
Patches
Plain Diff
doc: Build the docs without Buildstream installed
parent
f918205a
No related branches found
No related tags found
Loading
Pipeline
#27185498
passed
6 years ago
Stage: prepare
Stage: test
Stage: post
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+0
-1
0 additions, 1 deletion
.gitlab-ci.yml
doc/Makefile
+5
-3
5 additions, 3 deletions
doc/Makefile
doc/bst2html.py
+19
-3
19 additions, 3 deletions
doc/bst2html.py
with
24 additions
and
7 deletions
.gitlab-ci.yml
+
0
−
1
View file @
df7553b5
...
...
@@ -143,7 +143,6 @@ docs:
-
pip3 install sphinx-click
-
pip3 install sphinx_rtd_theme
-
cd dist && ./unpack.sh && cd buildstream
-
pip3 install .
-
make BST_FORCE_SESSION_REBUILD=1 -C doc
-
cd ../..
-
mv dist/buildstream/doc/build/html public
...
...
This diff is collapsed.
Click to expand it.
doc/Makefile
+
5
−
3
View file @
df7553b5
...
...
@@ -31,6 +31,9 @@ ifneq ($(strip $(BST_FORCE_SESSION_REBUILD)),)
BST2HTMLOPTS
=
--force
endif
# Help Python find buildstream and its plugins
PYTHONPATH
=
$(
CURDIR
)
/..:
$(
CURDIR
)
/../buildstream/plugins
.PHONY
:
all clean templates templates-clean sessions sessions-prep sessions-clean html devhelp
...
...
@@ -65,7 +68,6 @@ define plugin-doc-skeleton
endef
# We set PYTHONPATH here because source/conf.py sys.modules hacks dont seem to help sphinx-build import the plugins
all
:
html devhelp
clean
:
templates-clean sessions-clean
...
...
@@ -103,7 +105,7 @@ sessions-prep:
#
sessions
:
sessions-prep
for
file
in
$(
wildcard sessions/
*
.run
);
do
\
$(
BST2HTML
)
$(
BST2HTMLOPTS
)
--description
$$
file
;
\
PYTHONPATH
=
$(
PYTHONPATH
)
$(
BST2HTML
)
$(
BST2HTMLOPTS
)
--description
$$
file
;
\
done
sessions-clean
:
...
...
@@ -114,7 +116,7 @@ sessions-clean:
#
html devhelp
:
templates sessions
@
echo
"Building
$@
..."
PYTHONPATH
=
$(
CURDIR
)
/../buildstream/plugins
\
PYTHONPATH
=
$(
PYTHONPATH
)
\
$(
SPHINXBUILD
)
-b
$@
$(
ALLSPHINXOPTS
)
"
$(
BUILDDIR
)
/
$@
"
\
$(
wildcard
source
/
*
.rst
)
\
$(
wildcard
source
/tutorial/
*
.rst
)
\
...
...
This diff is collapsed.
Click to expand it.
doc/bst2html.py
+
19
−
3
View file @
df7553b5
...
...
@@ -37,6 +37,7 @@ import click
from
buildstream
import
_yaml
from
buildstream
import
utils
from
buildstream._frontend
import
cli
as
bst_cli
from
buildstream._exceptions
import
BstError
...
...
@@ -175,6 +176,19 @@ def ansi2html(text, palette='solarized'):
return
sub
@contextmanager
def
capture_stdout_stderr
():
from
io
import
StringIO
oldstdout
,
sys
.
stdout
=
sys
.
stdout
,
StringIO
()
oldstderr
,
sys
.
stderr
=
sys
.
stderr
,
StringIO
()
yield
sys
.
stdout
,
sys
.
stderr
sys
.
stdout
=
oldstdout
sys
.
stderr
=
oldstderr
# workdir()
#
# Sets up a new temp directory with a config file
...
...
@@ -219,9 +233,11 @@ def workdir(source_cache=None):
def
run_command
(
config_file
,
directory
,
command
):
click
.
echo
(
"
Running command in directory
'
{}
'
: bst {}
"
.
format
(
directory
,
command
),
err
=
True
)
argv
=
[
'
bst
'
,
'
--colors
'
,
'
--config
'
,
config_file
]
+
shlex
.
split
(
command
)
p
=
subprocess
.
Popen
(
argv
,
cwd
=
directory
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
out
,
_
=
p
.
communicate
()
args
=
[
'
--colors
'
,
'
--config
'
,
config_file
,
'
--directory
'
,
directory
]
+
shlex
.
split
(
command
)
with
capture_stdout_stderr
()
as
(
out
,
_
):
bst_cli
.
main
(
args
=
args
,
prog_name
=
bst_cli
.
name
)
return
out
.
decode
(
'
utf-8
'
).
strip
()
...
...
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