[ 
https://issues.apache.org/jira/browse/TINKERPOP-2995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17791401#comment-17791401
 ] 

ASF GitHub Bot commented on TINKERPOP-2995:
-------------------------------------------

kenhuuu commented on code in PR #2299:
URL: https://github.com/apache/tinkerpop/pull/2299#discussion_r1410051955


##########
run_examples.sh:
##########
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements.  See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership.  The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License.  You may obtain a copy of the License at
+#
+#http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied.  See the License for the
+#specific language governing permissions and limitations
+#under the License.
+
+open -a Docker
+docker pull tinkerpop/gremlin-server
+docker run -d --rm -p 8182:8182 --name glv-examples --health-cmd="curl -f 
http://localhost:8182/ || exit 1" --health-interval=5s --health-timeout=3s 
tinkerpop/gremlin-server
+
+echo
+echo "Not having docker open initially may cause an error loop. If so, simply 
restart this script."
+echo -n "Starting Gremlin server on port 8182..."
+until docker inspect --format '{{.State.Health.Status}}' glv-examples | grep 
-q "healthy"; do
+     echo -n "."
+     sleep 1
+done
+echo
+
+cd gremlin-driver/src/main/java/examples || exit
+mvn clean install
+
+echo
+echo "Running Java examples"
+java -cp target/run-examples-shaded.jar examples.Connections
+java -cp target/run-examples-shaded.jar examples.BasicGremlin
+cd ../../../../.. || exit
+
+echo
+echo "Running python examples:"
+python3 gremlin-python/src/main/python/examples/connections.py
+python3 gremlin-python/src/main/python/examples/basic_gremlin.py
+
+echo
+echo "Running JavaScript examples:"
+npm install --prefix gremlin-javascript/examples
+node gremlin-javascript/examples/connections.js
+node gremlin-javascript/examples/basic-gremlin.js
+
+echo
+echo "Running .NET examples:"
+dotnet run --project gremlin-dotnet/Examples/Connections
+dotnet run --project gremlin-dotnet/Examples/BasicGremlin
+
+echo
+echo "Running Go examples:"
+cd gremlin-go/examples || exit
+go run connections.go
+go run basic_gremlin.go
+cd ../.. || exit
+
+echo
+echo -n "Shutting down container: "
+docker stop glv-examples

Review Comment:
   Depending on whether or not something went wrong earlier or the user quit in 
the middle, this might not get called. Cleanup should be done in an EXIT trap 
sort like https://github.com/apache/tinkerpop/blob/master/docker/build.sh#L33





> Create Sample Applications in each GLV
> --------------------------------------
>
>                 Key: TINKERPOP-2995
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2995
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet, go, javascript, python
>    Affects Versions: 3.5.7
>            Reporter: Yang Xia
>            Priority: Major
>
> It would be great to have working example applications for each GLV, with 
> basic traversal examples and common connection settings. 
> Currently we have an `example.py` for python, but it is very minimal. There 
> is also an `example.go` for golang, but that appears to be outdated. As far 
> as I know, dotnet only has templates and javascript doesn't have any examples 
> at all. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to