forked from hechuan73/train_ticket
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from kagaya85/release
feat add Makefile
- Loading branch information
Showing
5 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Codewisdom Train-Ticket system | ||
|
||
Username=codewisdom | ||
Tag=0.1.0 | ||
|
||
# build image | ||
.PHONY: build | ||
build: clean-image package build-image | ||
|
||
.PHONY: package | ||
package: | ||
mvn clean package | ||
|
||
.PHONY: build-image | ||
build-image: | ||
@hack/build-image.sh $(Username) $(Tag) | ||
|
||
# push image | ||
.PHONY: push-image | ||
push-image: | ||
@hack/push-image.sh $(Username) | ||
|
||
.PHONY: clean | ||
clean: | ||
@mvn clean | ||
@hack/clean-image.sh $(Username) | ||
|
||
# clean image | ||
.PHONY: clean-image | ||
clean-image: | ||
@hack/clean-image.sh $(Username) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo | ||
echo "Start build images, Repo: $1, Tag: $2" | ||
echo | ||
for dir in ts-*; do | ||
if [[ -d $dir ]]; then | ||
if [[ -n $(ls "$dir" | grep -i Dockerfile) ]]; then | ||
echo "build ${dir}" | ||
docker build -t "$1"/"${dir}" "$dir" | ||
docker tag "$1"/"${dir}":latest "$1"/"${dir}":"$2" | ||
fi | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo | ||
echo "Clean images, Repo: $1" | ||
echo | ||
images=$(docker images | grep "$1"/ts- | awk '{print $3}') | ||
|
||
if [[ -n "$images" ]]; then | ||
echo "$images" | xargs -I {} docker rmi {} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo | ||
echo "Please input you repo password of $1" | ||
echo | ||
docker login --username="$1" | ||
|
||
echo | ||
echo "Start pushing image" | ||
echo | ||
docker images | grep "$1/ts" | awk 'BEGIN{OFS=":"}{print $1,$2}' | xargs -I {} docker push {} |
This file was deleted.
Oops, something went wrong.