Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
docker-makefile-sample
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sample
docker-makefile-sample
Commits
b87a2199
Commit
b87a2199
authored
Jul 21, 2021
by
Chavee Issariyapat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add buildarg
parent
6f93c3f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Makefile
+3
-2
No files found.
Makefile
View file @
b87a2199
# a helper shell script
# a helper shell script
MAKE_VERSION
=
1.2.
3
MAKE_VERSION
=
1.2.
5
define
MAKEFUNCTIONCODE
define
MAKEFUNCTIONCODE
function
hasChanges()
{
function
hasChanges()
{
...
@@ -128,6 +128,7 @@ VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion)
...
@@ -128,6 +128,7 @@ VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion)
VERSIONHASH
=
$(
shell
.
$(RELEASE_SUPPORT)
;
getVersionWithHash
)
VERSIONHASH
=
$(
shell
.
$(RELEASE_SUPPORT)
;
getVersionWithHash
)
TAG
=
$(
shell
.
$(RELEASE_SUPPORT)
;
getTag
)
TAG
=
$(
shell
.
$(RELEASE_SUPPORT)
;
getTag
)
PROJECTPATH
?=
.
PROJECTPATH
?=
.
BUILDARG
?=
RELEASE_SUPPORT
:=
$(
shell
dirname
$
(
abspath
$
(
lastword
$(MAKEFILE_LIST))))
/.make-function
RELEASE_SUPPORT
:=
$(
shell
dirname
$
(
abspath
$
(
lastword
$(MAKEFILE_LIST))))
/.make-function
export
MAKEFUNCTIONCODE
export
MAKEFUNCTIONCODE
...
@@ -196,7 +197,7 @@ post-init:
...
@@ -196,7 +197,7 @@ post-init:
@
rm .make-function
@
rm .make-function
docker-build
:
docker-build
:
docker build
-t
$(IMAGE)
:
$(VERSIONHASH)
$(PROJECTPATH)
docker build
$(BUILDARG)
-t
$(IMAGE)
:
$(VERSIONHASH)
$(PROJECTPATH)
@
DOCKER_MAJOR
=
$(
shell
docker
-v
| sed
-e
's/.*version //'
-e
's/,.*//'
| cut
-d
\.
-f1
)
;
\
@
DOCKER_MAJOR
=
$(
shell
docker
-v
| sed
-e
's/.*version //'
-e
's/,.*//'
| cut
-d
\.
-f1
)
;
\
DOCKER_MINOR
=
$(
shell
docker
-v
| sed
-e
's/.*version //'
-e
's/,.*//'
| cut
-d
\.
-f2
)
;
\
DOCKER_MINOR
=
$(
shell
docker
-v
| sed
-e
's/.*version //'
-e
's/,.*//'
| cut
-d
\.
-f2
)
;
\
if
[
$$
DOCKER_MAJOR
-eq
1
]
&&
[
$$
DOCKER_MINOR
-lt
10
]
;
then
\
if
[
$$
DOCKER_MAJOR
-eq
1
]
&&
[
$$
DOCKER_MINOR
-lt
10
]
;
then
\
...
...
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