Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
6209d8da
Commit
6209d8da
authored
Jun 17, 2016
by
Matthew Brett
Browse files
Add code-cleaning utility function
parent
09555a6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
common_utils.sh
common_utils.sh
+14
-1
No files found.
common_utils.sh
View file @
6209d8da
...
@@ -44,6 +44,19 @@ function rm_mkdir {
...
@@ -44,6 +44,19 @@ function rm_mkdir {
mkdir
$path
mkdir
$path
}
}
function
clean_code
{
local
repo_dir
=
${
1
:-
$REPO_DIR
}
local
build_commit
=
${
2
:-
$BUILD_COMMIT
}
[
-z
"
$repo_dir
"
]
&&
echo
"repo_dir not defined"
&&
exit
1
[
-z
"
$build_commit
"
]
&&
echo
"build_commit not defined"
&&
exit
1
(
cd
$repo_dir
\
&&
git fetch origin
\
&&
git checkout
$build_commit
\
&&
git clean
-fxd
\
&&
git reset
--hard
\
&&
git submodule update
--init
--recursive
)
}
function
build_wheel
{
function
build_wheel
{
# Builds wheel, puts into $WHEEL_SDIR
# Builds wheel, puts into $WHEEL_SDIR
#
#
...
@@ -57,7 +70,7 @@ function build_wheel {
...
@@ -57,7 +70,7 @@ function build_wheel {
local
wheelhouse
=
$(
abspath
${
WHEEL_SDIR
:-
wheelhouse
}
)
local
wheelhouse
=
$(
abspath
${
WHEEL_SDIR
:-
wheelhouse
}
)
if
[
-n
$(
is_function
"pre_build"
)
]
;
then
pre_build
;
fi
if
[
-n
$(
is_function
"pre_build"
)
]
;
then
pre_build
;
fi
if
[
-n
"
$BUILD_DEPENDS
"
]
;
then
pip
install
$(
pip_opts
)
$BUILD_DEPENDS
;
fi
if
[
-n
"
$BUILD_DEPENDS
"
]
;
then
pip
install
$(
pip_opts
)
$BUILD_DEPENDS
;
fi
(
cd
$repo_dir
&&
pip wheel
$(
pip_opts
)
-w
$wheelhouse
--no-deps
.
)
(
cd
$repo_dir
&&
pip wheel
$(
pip_opts
)
-w
$wheelhouse
--no-deps
.
)
repair_wheelhouse
$wheelhouse
repair_wheelhouse
$wheelhouse
}
}
...
...
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