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
7940e731
Commit
7940e731
authored
May 05, 2019
by
Chavee Issariyapat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 1.1.6
parent
0b01508d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
Makefile
+22
-7
No files found.
Makefile
View file @
7940e731
# a helper shell script
# a helper shell script
MAKE_VERSION
=
1.1.
5
MAKE_VERSION
=
1.1.
6
define
MAKEFUNCTIONCODE
define
MAKEFUNCTIONCODE
function
hasChanges()
{
function
hasChanges()
{
...
@@ -116,16 +116,27 @@ endif
...
@@ -116,16 +116,27 @@ endif
ifeq
(images,$(firstword
$(MAKECMDGOALS)))
ifeq
(images,$(firstword
$(MAKECMDGOALS)))
doit
=
true
doit
=
true
endif
endif
ifeq
(deploy,$(firstword
$(MAKECMDGOALS)))
doit
=
true
endif
ifdef
doit
ifdef
doit
# use the rest as arguments for "
run
"
# use the rest as arguments for "
make xxx
"
RMI
_ARGS
:=
$
(
wordlist 2,
$
(
words
$(MAKECMDGOALS)
)
,
$(MAKECMDGOALS)
)
CMD
_ARGS
:=
$
(
wordlist 2,
$
(
words
$(MAKECMDGOALS)
)
,
$(MAKECMDGOALS)
)
# ...and turn them into do-nothing targets
# ...and turn them into do-nothing targets
$(eval $(RMI_ARGS)
:
;@:)
$(eval $(CMD_ARGS)
:
;@:)
endif
ifeq
($(CMD_ARGS),)
else
EMPTY
=
SPACE
=
$(EMPTY)
$(EMPTY)
TDARG
=
$
(
subst
$(SPACE)
,
--context
=
,
$(CMD_ARGS)
)
DARG
=
-n
$(TDARG)
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 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
push do-push post-push post-init update-make rmi images
deploy
init
:
init
:
@
echo
"
$$
MAKEFUNCTIONCODE"
>
./.make-function
@
echo
"
$$
MAKEFUNCTIONCODE"
>
./.make-function
...
@@ -225,11 +236,11 @@ make-version:
...
@@ -225,11 +236,11 @@ make-version:
# awk to cut the column 3, xargs to run command passing arg from pipe
# awk to cut the column 3, xargs to run command passing arg from pipe
delete-docker-image
:
delete-docker-image
:
@
docker images |
grep
$(
RMI
_ARGS)
| awk
'{print $$3}'
| xargs docker rmi
||
true
@
docker images |
grep
$(
CMD
_ARGS)
| awk
'{print $$3}'
| xargs docker rmi
||
true
# || true to force exoit code to 0 otherwise if no line matched, make will show some error
# || true to force exoit code to 0 otherwise if no line matched, make will show some error
list-docker-image
:
list-docker-image
:
@
docker images |
grep
$(
RMI
_ARGS)
||
true
@
docker images |
grep
$(
CMD
_ARGS)
||
true
env-snippet
:
env-snippet
:
@
jq
-r
'..|select(type=="string") + "="'
config/custom-environment-variables.json
>
_temp_file_.env
@
jq
-r
'..|select(type=="string") + "="'
config/custom-environment-variables.json
>
_temp_file_.env
...
@@ -238,3 +249,7 @@ env-snippet:
...
@@ -238,3 +249,7 @@ env-snippet:
@
rm _temp_file_.env
@
rm _temp_file_.env
@
rm nexpieconfig.yaml
@
rm nexpieconfig.yaml
@
rm env-snippet-nexpieconfig.yaml
@
rm env-snippet-nexpieconfig.yaml
deploy
:
init release.conf
echo
$(DARG)
@
cat
k8s/deployment.yaml | sed
"s/{{IMAGE_TAG}}/
$(VERSION)
/g"
| kubectl apply
-f
-
$(DARG)
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