Skip to content

Commit ba3adae

Browse files
authored
Improve deploy server and test dbpedia music (#131)
* fix: disable post, put and delete method * fix: run docker as user * fix: add dbpedia ontology * fix: add ci dbpedia music * fix: path * fix: test using pink floyd * fix: wait for the server
1 parent 4792bb0 commit ba3adae

File tree

7 files changed

+30576
-7
lines changed

7 files changed

+30576
-7
lines changed

.ci/dbpedia_music.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set -xe
2+
3+
java -jar target/oba-*-jar-with-dependencies.jar -c examples/dbpedia/config_music.yaml
4+
pushd outputs/dbpedia_music/servers/python
5+
bash generate-server.sh
6+
pushd server
7+
docker build -t openapi_server .
8+
docker run --name dbpedia_music -d -p 8080:8080 openapi_server
9+
popd
10+
sleep 10s
11+
curl -X GET "http://0.0.0.0:8080/v1.3.0/bands/Pink_Floyd" -H "accept: application/json"
12+
docker logs dbpedia_music

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: java
22
script:
33
- mvn package
4+
- bash .ci/dbpedia_music.sh
45
before_deploy:
56
- ls -lR
67
deploy:

examples/dbpedia/config_full.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ openapi:
2020
## Ontologies
2121
### List of ontologies
2222
ontologies:
23-
- https://gist.githubusercontent.com/mosoriob/cec147b24bd241295584dfcc21c21b93/raw/b6fa41ddf93212d967f35da20278f54d2ae2d40d/gistfile1.txt
23+
- examples/dbpedia/ontology.xml
2424

2525
## SPARQL information
2626
endpoint:

examples/dbpedia/config_music.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@ openapi:
2020
## Ontologies
2121
### List of ontologies
2222
ontologies:
23-
- https://gist.githubusercontent.com/mosoriob/cec147b24bd241295584dfcc21c21b93/raw/b6fa41ddf93212d967f35da20278f54d2ae2d40d/gistfile1.txt
23+
- examples/dbpedia/ontology.xml
2424

2525
## SPARQL information
2626
endpoint:
2727
url: http://dbpedia.org/sparql
2828
prefix: http://dbpedia.org/resource
29-
graph_base: http://ontosoft.isi.edu:3030/modelCatalog-1.2.0/data/
3029

3130
## Filter the paths by methods
3231
enable_get_paths: true
33-
enable_post_paths: true
34-
enable_delete_paths: true
35-
enable_put_paths: true
32+
enable_post_paths: false
33+
enable_delete_paths: false
34+
enable_put_paths: false
3635

3736
## Select the classes to add in the API
3837
classes:

examples/dbpedia/ontology.xml

+30,553
Large diffs are not rendered by default.

src/main/resources/servers.zip

14 Bytes
Binary file not shown.

src/main/resources/servers/python/generate-server.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ dir=${PWD}
1818
cp ../openapi.yaml ${PWD}
1919

2020
SERVER_DIR=server
21-
docker run -ti --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.1.2 \
21+
22+
23+
docker run -ti --rm -v ${PWD}:/local \
24+
-u "$(id -u):$(id -u)" \
25+
openapitools/openapi-generator-cli:v4.1.2 \
2226
generate \
2327
-i /local/openapi.yaml\
2428
-g python-flask \

0 commit comments

Comments
 (0)