Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
bc3421b5dccc
Commit
bc3421b5dccc
authored
5 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
exit with error when having errors on documentation generation
parent
b76a9d43d430
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
create_documentation
+31
-21
31 additions, 21 deletions
create_documentation
with
31 additions
and
21 deletions
create_documentation
+
31
−
21
View file @
bc3421b5
...
...
@@ -13,7 +13,8 @@
project_home
=
$(
cd
$here
&&
cd
..
&&
echo
$PWD
)
project_name_from_home
=
$(
basename
$project_home
)
project_name
=
${
DRONE_REPO_NAME
:-
project_name_from_home
}
languages
=(
${
LANGUAGES
:-
en
}
)
format
=
html
out_dir
=
${
project_home
}
/_build/
$format
...
...
@@ -16,7 +17,9 @@
format
=
html
out_dir
=
${
project_home
}
/_build/
$format
error
=
0
# color stuff
autoload colors
&&
colors
for
COLOR
in
RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE
;
do
...
...
@@ -29,5 +32,5 @@
# determine branch name
if
[
-n
"
$DRONE_BRANCH
"
]
;
then
branch
=
"
$DRONE_BRANCH
"
branch
=
"
$DRONE_BRANCH
"
elif
[
-e
".git"
]
;
then
...
...
@@ -33,3 +36,3 @@
elif
[
-e
".git"
]
;
then
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
elif
[
-e
".hg"
]
;
then
...
...
@@ -35,3 +38,3 @@
elif
[
-e
".hg"
]
;
then
branch
=
"
$(
hg
id
-b
)
"
branch
=
"
$(
hg
id
-b
)
"
else
...
...
@@ -37,4 +40,4 @@
else
echo
"
${
RED
}
WARN
${
RESET
}
- Branch name not found"
branch
=
"unknown"
echo
"
${
RED
}
WARN
${
RESET
}
- Branch name not found"
branch
=
"unknown"
fi
...
...
@@ -40,5 +43,6 @@
fi
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Branch name:
$branch
"
for
doc_dir
in
doc docs
;
do
if
[[
-d
"
$doc_dir
"
]]
;
then
pushd
$doc_dir
...
...
@@ -41,6 +45,6 @@
for
doc_dir
in
doc docs
;
do
if
[[
-d
"
$doc_dir
"
]]
;
then
pushd
$doc_dir
for
language
in
"en"
;
do
for
language
in
$languages
;
do
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
...
...
@@ -46,10 +50,10 @@
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
# TODO read value from Makefile
builddir
=
_bu
il
d
dest_dir
=
$out_dir
/
$project_name
/
$language
/
$branch
if
[[
$?
-eq
0
]]
;
then
if
[[
$?
-eq
0
]]
;
then
# TODO read value from Makef
il
e
builddir
=
_build
dest_dir
=
$out_dir
/
$project_name
/
$language
/
$branch
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation done for
$doc_dir
(superproject), copy to
$dest_dir
"
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
"
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed for
$doc_dir
(superproject)"
...
...
@@ -51,8 +55,9 @@
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation done for
$doc_dir
(superproject), copy to
$dest_dir
"
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
"
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed for
$doc_dir
(superproject)"
((
error++
))
fi
done
popd
...
...
@@ -74,5 +79,13 @@
pushd
$module_path
module
=
$(
basename
$module_path
)
has_doc
=
""
if
[
-e
".git"
]
;
then
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
elif
[
-e
".hg"
]
;
then
branch
=
"
$(
hg identify
--branch
)
"
else
echo
"
${
RED
}
WARN
${
RESET
}
- Branch name not found"
branch
=
"default"
fi
for
doc_dir
in
doc docs
;
do
if
[[
-d
$doc_dir
&&
-e
$doc_dir
/Makefile
]]
;
then
...
...
@@ -77,5 +90,6 @@
for
doc_dir
in
doc docs
;
do
if
[[
-d
$doc_dir
&&
-e
$doc_dir
/Makefile
]]
;
then
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Branch name:
$branch
"
has_doc
=
True
echo
${
YELLOW
}
INFO
${
RESET
}
- Makefile found
in
$dir
/
$module_path
/
$doc_dir
pushd
$doc_dir
...
...
@@ -79,11 +93,4 @@
has_doc
=
True
echo
${
YELLOW
}
INFO
${
RESET
}
- Makefile found
in
$dir
/
$module_path
/
$doc_dir
pushd
$doc_dir
if
[
-e
".git"
]
;
then
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
elif
[
-e
".hg"
]
;
then
branch
=
"
$(
hg
id
-b
)
"
else
branch
=
"default"
fi
# TODO read value from Makefile
...
...
@@ -89,3 +96,3 @@
# TODO read value from Makefile
for
language
in
"en"
;
do
for
language
in
$languages
;
do
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
...
...
@@ -91,5 +98,2 @@
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
# TODO read value from Makefile
builddir
=
_build
dest_dir
=
$out_dir
/
$module
/
$language
/
$branch
if
[[
$?
-eq
0
]]
;
then
...
...
@@ -95,6 +99,9 @@
if
[[
$?
-eq
0
]]
;
then
# TODO read value from Makefile
builddir
=
_build
dest_dir
=
$out_dir
/
$module
/
$language
/
$branch
echo
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation
done for
$dir
/
$module_path
/
$doc_dir
, copy to
$dest_dir
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed
for
$dir
/
$module_path
/
$doc_dir
...
...
@@ -96,8 +103,9 @@
echo
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation
done for
$dir
/
$module_path
/
$doc_dir
, copy to
$dest_dir
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed
for
$dir
/
$module_path
/
$doc_dir
((
error++
))
fi
done
popd
...
...
@@ -111,3 +119,5 @@
done
popd
exit
$error
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