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
bbaf0ca90ec6
Commit
bbaf0ca90ec6
authored
6 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
add CREATED and REVISION in all build args, and fix --build-arg to work
parent
009bfee247e9
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
docker_build.py
+16
-5
16 additions, 5 deletions
docker_build.py
with
16 additions
and
5 deletions
docker_build.py
+
16
−
5
View file @
bbaf0ca9
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
"""
"""
# Version 2.19
# Version 2.19
import
argparse
import
argparse
import
datetime
import
json
import
json
import
logging
import
logging
import
os
import
os
import
signal
import
signal
...
@@ -9,8 +10,8 @@
...
@@ -9,8 +10,8 @@
import
json
import
json
import
logging
import
logging
import
os
import
os
import
signal
import
signal
from
subprocess
import
call
from
subprocess
import
call
,
check_output
import
sys
import
sys
from
six.moves
import
configparser
from
six.moves
import
configparser
...
@@ -24,7 +25,7 @@
...
@@ -24,7 +25,7 @@
_logger
=
logging
.
getLogger
(
__name__
)
_logger
=
logging
.
getLogger
(
__name__
)
__version__
=
'
0.1.
2
'
__version__
=
'
0.1.
3
'
__date__
=
'
2018-04-04
'
__date__
=
'
2018-04-04
'
__updated__
=
'
2018-11-19
'
__updated__
=
'
2018-11-19
'
...
@@ -89,5 +90,6 @@
...
@@ -89,5 +90,6 @@
)
)
parser
.
add_argument
(
parser
.
add_argument
(
'
--build-arg
'
,
'
--build-arg
'
,
help
=
"
add dev feature to generated image [default: %(default)s]
"
,
help
=
"
build arg for the image, formated like FOO=BAR
"
"
[default: %(default)s]
"
,
default
=
None
,
default
=
None
,
...
@@ -93,4 +95,5 @@
...
@@ -93,4 +95,5 @@
default
=
None
,
default
=
None
,
nargs
=
'
*
'
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
'
--no-pull
'
,
'
--no-pull
'
,
...
@@ -94,7 +97,8 @@
...
@@ -94,7 +97,8 @@
)
)
parser
.
add_argument
(
parser
.
add_argument
(
'
--no-pull
'
,
'
--no-pull
'
,
help
=
"
indicate to docker to not pull the base image [default: %(default)s]
"
,
help
=
"
indicate to docker to not pull the base image
"
"
[default: %(default)s]
"
,
action
=
'
store_true
'
,
action
=
'
store_true
'
,
)
)
# TODO (maybe) add argument for other build arg
# TODO (maybe) add argument for other build arg
...
@@ -153,7 +157,14 @@
...
@@ -153,7 +157,14 @@
signal
.
signal
(
signal
.
SIGTERM
,
signal_handler
)
signal
.
signal
(
signal
.
SIGTERM
,
signal_handler
)
# TODO docker build
# TODO docker build
buildargs
=
nmspc
.
build_arg
buildargs
=
dict
()
buildargs
[
'
REVISION
'
]
=
check_output
(
'
hg identify -i
'
.
split
()).
split
()[
0
]
buildargs
[
'
CREATED
'
]
=
datetime
.
datetime
.
now
().
isoformat
()
if
nmspc
.
build_arg
:
for
arg
in
nmspc
.
build_arg
:
a
=
arg
.
split
(
'
=
'
)
buildargs
[
a
[
0
]]
=
a
[
1
]
logging
.
debug
(
"
Build args: %s
"
,
buildargs
)
dockerfile
=
'
Dockerfile
'
dockerfile
=
'
Dockerfile
'
if
dev
:
if
dev
:
debug_dockerfile
=
'
Dockerfile.debug
'
debug_dockerfile
=
'
Dockerfile.debug
'
...
...
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