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
6f93c3f9
Commit
6f93c3f9
authored
Jul 12, 2020
by
Chavee Issariyapat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cleanbuild
parent
ed68f7c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
+19
-1
Makefile
+19
-1
No files found.
Makefile
View file @
6f93c3f9
...
@@ -174,7 +174,7 @@ endif
...
@@ -174,7 +174,7 @@ endif
# endif
# endif
.PHONY
:
pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showtag show-tag
\
.PHONY
:
pre-build docker-build post-build build
cleanbuild
release patch-release minor-release major-release tag check-status check-release showtag show-tag
\
push do-push post-push post-init update-make rmi images deploy show-deploy annotate rollback
push do-push post-push post-init update-make rmi images deploy show-deploy annotate rollback
init
:
init
:
...
@@ -182,6 +182,8 @@ init:
...
@@ -182,6 +182,8 @@ init:
build
:
init pre-build docker-build post-build
build
:
init pre-build docker-build post-build
cleanbuild
:
init pre-build docker-cleanbuild post-build
pre-build
:
pre-build
:
post-build
:
post-build
:
...
@@ -194,6 +196,22 @@ post-init:
...
@@ -194,6 +196,22 @@ post-init:
@
rm .make-function
@
rm .make-function
docker-build
:
docker-build
:
docker build
-t
$(IMAGE)
:
$(VERSIONHASH)
$(PROJECTPATH)
@
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
)
;
\
if
[
$$
DOCKER_MAJOR
-eq
1
]
&&
[
$$
DOCKER_MINOR
-lt
10
]
;
then
\
echo
docker tag
-f
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:latest
;
\
docker tag
-f
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:latest
;
\
echo
docker tag
-f
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:
$(VERSION)
;
\
docker tag
-f
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:
$(VERSION)
;
\
else
\
echo
docker tag
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:latest
;
\
docker tag
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:latest
;
\
echo
docker tag
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:
$(VERSION)
;
\
docker tag
$(IMAGE)
:
$(VERSIONHASH)
$(IMAGE)
:
$(VERSION)
;
\
fi
docker-cleanbuild
:
docker build
--no-cache
-t
$(IMAGE)
:
$(VERSIONHASH)
$(PROJECTPATH)
docker build
--no-cache
-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
)
;
\
...
...
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