Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
moqui
/
k8s-moqui
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
90b2ad5b
authored
2024-03-08 16:23:23 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add a config file feature(.build.env).
1 parent
34a347c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
build.sh
build.sh
View file @
90b2ad5
...
...
@@ -2,10 +2,6 @@
set
-e
TAG
=
test
-latest
APP
=
moqui-app
PUSH_TO
=
docker://5.161.91.120:31234
PREFIX
=
declare
-a
images
=(
moqui-jdbc-drivers moqui-app
)
TOP_DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
-P
)
"
...
...
@@ -23,6 +19,11 @@ _push() {
done
}
APP
=
moqui-app
OVERRIDE_TAG
=
DEVELOPER
=
PUSH_TO
=
PREFIX
=
while
[[
$#
-gt 0
]]
;
do
case
"
$1
"
in
(
--app
)
...
...
@@ -38,7 +39,11 @@ while [[ $# -gt 0 ]]; do
shift
2
;;
(
--tag
)
TAG
=
"
$2
"
OVERRIDE_TAG
=
"
$2
"
shift
2
;;
(
--developer
)
DEVELOPER
=
"
$2
"
shift
2
;;
(
*
)
...
...
@@ -46,6 +51,34 @@ while [[ $# -gt 0 ]]; do
;;
esac
done
declare
-A
build_env
=()
if
[[
-f
$APP
/.build.env
]]
;
then
set
-x
while
read
line;
do
[[
$line
=
^
"#"
.
*
]]
&&
continue
if
[[
$line
=
~ ^
\s
*
(
.
*
?
)
\s
*
=
\s
*
(
.
*
?
)
\s
*
$
]]
;
then
build_env[
${
BASH_REMATCH
[1]
}
]=
"
${
BASH_REMATCH
[2]
}
"
fi
done
<
"
$APP
/.build.env"
set
+x
fi
[[
-z
$OVERRIDE_TAG
]]
&&
OVERRIDE_TAG
=
"
${
build_env
[
"override-tag"
]
}
"
[[
-z
$DEVELOPER
]]
&&
DEVELOPER
=
"
${
build_env
[
"developer"
]
}
"
[[
-z
$PREFIX
]]
&&
PREFIX
=
"
${
build_env
[
"prefix"
]
}
"
[[
-z
$PUSH_TO
]]
&&
PUSH_TO
=
"
${
build_env
[
"push-to"
]
}
"
if
[[
$OVERRIDE_TAG
]]
;
then
TAG
=
"
$OVERRIDE_TAG
"
elif
[[
-e
$APP
/.git
]]
;
then
TAG
=
"
$(
GIT_DIR
=
"
$APP
/.git"
git branch --show-current
)
"
else
TAG
=
test
-latest
fi
if
[[
$DEVELOPER
]]
;
then
TAG+
=
"-
$DEVELOPER
"
fi
case
"
$1
"
in
(
build
)
_build
...
...
Please
register
or
sign in
to post a comment