-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hanl5
committed
Sep 30, 2024
1 parent
af5b662
commit fbbf1ef
Showing
19 changed files
with
129 additions
and
115 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
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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
#!/bin/bash | ||
cd "$( | ||
cd "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)/" || exit | ||
set -e | ||
|
||
build_server() { | ||
echo "~~~ build grpc server java ~~~" | ||
cd ../hello-grpc-java | ||
mvn clean install -DskipTests -f server_pom.xml | ||
cp target/hello-grpc-java-server.jar ../docker/ | ||
|
||
cd ../docker | ||
docker build -f java_grpc.dockerfile --target server -t feuyeux/grpc_server_java:1.0.0 --pull . | ||
rm -rf hello-grpc-java-server.jar | ||
echo | ||
} | ||
|
||
build_client() { | ||
echo "~~~ build grpc client java ~~~" | ||
cd ../hello-grpc-java | ||
mvn clean install -DskipTests -f client_pom.xml | ||
cp target/hello-grpc-java-client.jar ../docker/ | ||
|
||
cd ../docker | ||
docker build -f java_grpc.dockerfile --target client -t feuyeux/grpc_client_java:1.0.0 --pull . | ||
rm -rf hello-grpc-java-client.jar | ||
echo | ||
} | ||
|
||
if [ "$1" == "server" ]; then | ||
build_server | ||
elif [ "$1" == "client" ]; then | ||
build_client | ||
else | ||
build_server | ||
build_client | ||
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,10 @@ | ||
FROM openjdk:21-jdk-slim AS server | ||
COPY hello-grpc-java-server.jar grpc-server.jar | ||
COPY tls/server_certs /var/hello_grpc/server_certs | ||
COPY tls/client_certs /var/hello_grpc/client_certs | ||
ENTRYPOINT ["java","-jar","/grpc-server.jar"] | ||
|
||
FROM openjdk:21-jdk-slim AS client | ||
COPY hello-grpc-java-client.jar grpc-client.jar | ||
COPY tls/client_certs /var/hello_grpc/client_certs | ||
CMD ["java","-jar","/grpc-client.jar"] |
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,3 @@ | ||
#!/bin/bash | ||
docker push feuyeux/grpc_server_java:1.0.0 | ||
docker push feuyeux/grpc_client_java:1.0.0 |
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,13 @@ | ||
#!/bin/bash | ||
cd "$( | ||
cd "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)/" || exit | ||
export CLIENT_NAME=grpc_client_java | ||
export CLIENT_IMG=feuyeux/$CLIENT_NAME:1.0.0 | ||
# if there's first argument, it's secure, otherwise insecure | ||
if [ "$1" = "secure" ]; then | ||
sh run_tls_client.sh | ||
else | ||
sh run_insecure_client.sh | ||
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,13 @@ | ||
#!/bin/bash | ||
cd "$( | ||
cd "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)/" || exit | ||
export SERVER_NAME=grpc_server_java | ||
export SERVER_IMG=feuyeux/$SERVER_NAME:1.0.0 | ||
# if there's first argument, it's secure, otherwise insecure | ||
if [ "$1" = "secure" ]; then | ||
sh run_tls_server.sh | ||
else | ||
sh run_insecure_server.sh | ||
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
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,12 @@ | ||
FROM openjdk:21-jdk-slim AS server | ||
COPY server_start.sh server_start.sh | ||
COPY proto-server-all.jar lib/proto-server-all.jar | ||
COPY tls/server_certs /var/hello_grpc/server_certs | ||
COPY tls/client_certs /var/hello_grpc/client_certs | ||
ENTRYPOINT ["sh","server_start.sh"] | ||
|
||
FROM openjdk:21-jdk-slim AS client | ||
COPY client_start.sh client_start.sh | ||
COPY proto-client-all.jar lib/proto-client-all.jar | ||
COPY tls/client_certs /var/hello_grpc/client_certs | ||
ENTRYPOINT ["sh","client_start.sh"] |
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,3 @@ | ||
#!/bin/bash | ||
docker push feuyeux/grpc_server_kotlin:1.0.0 | ||
docker push feuyeux/grpc_client_kotlin:1.0.0 |
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,13 @@ | ||
#!/bin/bash | ||
cd "$( | ||
cd "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)/" || exit | ||
export CLIENT_NAME=grpc_client_kotlin | ||
export CLIENT_IMG=feuyeux/$CLIENT_NAME:1.0.0 | ||
# if there's first argument, it's secure, otherwise insecure | ||
if [ "$1" = "secure" ]; then | ||
sh run_tls_client.sh | ||
else | ||
sh run_insecure_client.sh | ||
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,13 @@ | ||
#!/bin/bash | ||
cd "$( | ||
cd "$(dirname "$0")" >/dev/null 2>&1 | ||
pwd -P | ||
)/" || exit | ||
export SERVER_NAME=grpc_server_kotlin | ||
export SERVER_IMG=feuyeux/$SERVER_NAME:1.0.0 | ||
# if there's first argument, it's secure, otherwise insecure | ||
if [ "$1" = "secure" ]; then | ||
sh run_tls_server.sh | ||
else | ||
sh run_insecure_server.sh | ||
fi |