-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/windows #78
Feature/windows #78
Changes from all commits
591bd2d
9c7a1fc
144cafa
fba1c5b
dccf7cd
66a6925
458d873
957cbc0
3c10ef8
d063d3b
5e88f3f
b779aa6
bc5ff4d
7a929bd
eccae0f
b8249cb
d3685d6
ca79dc9
a914ceb
f72dc82
438d39c
c9566da
88feb4c
686285f
06b1509
abbdd4b
61276f4
1257398
55c6d76
84807ff
5b23a79
5765c51
4e81af5
5319379
d0d7c2f
f23d9ba
e1c4b63
357a085
290c3a1
67b4e11
b1a3e33
d2ccec6
d548d6e
796412c
4119543
982ec82
edbb50e
1b83047
2381839
9d9d230
d072363
8cb8b2a
f02d333
f4d9c5f
9b2b510
1c9b302
f6d176f
f799bda
216671a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
* text eol=lf | ||
*.bat text eol=crlf | ||
|
||
*.asc.enc binary | ||
|
||
*.png binary | ||
*.ico binary | ||
*.gif binary |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,8 @@ stop_docker() { | |
} | ||
|
||
start_container() { | ||
# fix: do not re-create | ||
docker network create --driver bridge ${docker_network} >/dev/null 2>&1 | ||
docker network ls | grep ${docker_network} 1>/dev/null || \ | ||
docker network create --driver bridge ${docker_network} >/dev/null 2>&1 | ||
|
||
cid=$(docker ps -aqf name=${1}) | ||
|
||
|
@@ -96,7 +96,7 @@ start_container() { | |
usage "docker run --net=${docker_network} --name ${1} ${3} -d ${2} ${4}" 1 | ||
# todo: ?better way? ... see about moving polling to the app-start | ||
beerMe 30 | ||
elif [ "${cid}" != "running" ]; then | ||
else | ||
cids=$(docker inspect --format '{{.State.Status}}' ${cid}) | ||
|
||
if [ "${cids}" == "paused" ]; then | ||
|
@@ -141,27 +141,18 @@ start_wasabi() { | |
start_docker | ||
|
||
id=$(fromPom modules/main development application.name) | ||
wcip=$(docker inspect --format "{{ .NetworkSettings.Networks.${docker_network}.IPAddress }}" ${project}-cassandra) | ||
wmip=$(docker inspect --format "{{ .NetworkSettings.Networks.${docker_network}.IPAddress }}" ${project}-mysql) | ||
|
||
remove_container ${project}-main | ||
|
||
if [ "${verify}" = true ] || ! [ docker inspect ${project}-main >/dev/null 2>&1 ]; then | ||
echo "${green}${project}: building${reset}" | ||
|
||
# sed -i -e "s|\(http://\)localhost\(:8080\)|\1${mip}\2|g" modules/main/target/${id}/content/ui/dist/scripts/config.js 2>/dev/null; | ||
docker build -t ${project}-main:${USER}-$(date +%s) -t ${project}-main:latest modules/main/target/${id} | ||
docker build -t ${project}-main:$(git rev-parse --short=8 HEAD) -t ${project}-main:latest modules/main/target/${id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @felixgao's idea :-) |
||
fi | ||
|
||
echo "${green}${project}: starting${reset}" | ||
|
||
wenv="WASABI_CONFIGURATION=-DnodeHosts=${wcip} -Ddatabase.url.host=${wmip}" | ||
|
||
# fixme: try to reuse the start_container() method instead of 'docker run...' directly; currently a problem with quotes in ${wenv} being passed into container. | ||
docker run --net=${docker_network} --name ${project}-main -p 8080:8080 -p 8090:8090 -p 8180:8180 \ | ||
-e "${wenv}" -d ${project}-main || \ | ||
usage "docker run --net=${docker_network} --name ${project}-main -p 8080:8080 -p 8090:8090 -p 8180:8180 -e \"${wenv}\" -d ${project}-main" 1 | ||
|
||
start_container ${project}-main ${project}-main:$(git rev-parse --short=8 HEAD) "-p 8080:8080 -p 8090:8090 -p 8180:8180 -e WASABI_CONFIGURATION=\"-DnodeHosts=${project}-cassandra -Ddatabase.url.host=${project}-mysql\"" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. quite nice :) |
||
echo -ne "${green}chill'ax ${reset}" | ||
|
||
status | ||
|
@@ -175,39 +166,23 @@ start_cassandra() { | |
} | ||
|
||
console_cassandra() { | ||
wcip=$(docker inspect --format "{{ .NetworkSettings.Networks.${docker_network}.IPAddress }}" ${project}-cassandra) | ||
|
||
docker run --net=${docker_network} -it --rm ${cassandra} cqlsh ${wcip} || \ | ||
usage "unable to run command: docker run --net=${docker_network} -it --rm ${cassandra} cqlsh ${wcip}" 1 | ||
docker run --net=${docker_network} -it --rm ${cassandra} cqlsh ${project}-cassandra || \ | ||
usage "unable to run command: % docker run --net=${docker_network} -it --rm ${cassandra} cqlsh ${project}-cassandra" 1 | ||
} | ||
|
||
start_mysql() { | ||
pwd=mypass | ||
|
||
start_docker | ||
start_container ${project}-mysql ${mysql} "-p 3306:3306 -e MYSQL_ROOT_PASSWORD=${pwd}" | ||
|
||
wmip=$(docker inspect --format "{{ .NetworkSettings.Networks.${docker_network}.IPAddress }}" ${project}-mysql) | ||
sql=$(cat << EOF | ||
create database if not exists ${project}; | ||
grant all privileges on ${project}.* to 'readwrite'@'localhost' identified by 'readwrite'; | ||
grant all on *.* to 'readwrite'@'%' identified by 'readwrite'; | ||
flush privileges; | ||
EOF | ||
) | ||
|
||
docker run --net=${docker_network} -it --rm ${mysql} mysql -h${wmip} -P3306 -uroot -p${pwd} -e "${sql}" || \ | ||
usage "unable to run command: % docker run --net=${docker_network} -it --rm ${mysql} mysql -h${wmip} -P3306 -uroot -p${pwd} -e \"${sql}\"" 1 | ||
start_container ${project}-mysql ${mysql} "-p 3306:3306 -e MYSQL_ROOT_PASSWORD=${pwd} -e MYSQL_DATABASE=${project} -e MYSQL_USER=readwrite -e MYSQL_PASSWORD=readwrite" | ||
|
||
[ "${verify}" = true ] && console_mysql | ||
} | ||
|
||
console_mysql() { | ||
pwd=mypass | ||
wmip=$(docker inspect --format "{{ .NetworkSettings.Networks.${docker_network}.IPAddress }}" ${project}-mysql) | ||
|
||
docker run --net=${docker_network} -it --rm ${mysql} mysql -h${wmip} -P3306 -uroot -p${pwd} || \ | ||
usage "unable to run command: % docker run --net=${docker_network} -it --rm ${mysql} mysql -h${wmip} -P3306 -uroot -p${pwd}" 1 | ||
docker run --net=${docker_network} -it --rm ${mysql} mysql -h${project}-mysql -P3306 -uroot -p${pwd} || \ | ||
usage "unable to run command: % docker run --net=${docker_network} -it --rm ${mysql} mysql -h${project}-mysql -P3306 -uroot -p${pwd}" 1 | ||
} | ||
|
||
status() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice points!