Skip to content
Snippets Groups Projects
Verified Commit ae83fde8 authored by Martin Weise's avatar Martin Weise
Browse files

Different exec order

parent 69800a3f
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,12 @@ deploy-dockerhub-docs: ...@@ -14,11 +14,12 @@ deploy-dockerhub-docs:
verify: verify:
sudo nginx -t sudo nginx -t
build: build-swagger build:
mkdocs build mkdocs build
bash ./swagger/generate.sh
build-swagger: build-swagger:
cd ./swagger && bash ./generate.sh bash ./swagger/generate.sh
deploy-docs: deploy-docs:
tar czfv ./final.tar.gz ./final tar czfv ./final.tar.gz ./final
......
...@@ -9,36 +9,37 @@ services[9099]=metadata ...@@ -9,36 +9,37 @@ services[9099]=metadata
function retrieve () { function retrieve () {
echo "... retrieving swagger yaml" echo "... retrieving swagger yaml"
wget "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.docs/api-$2.yaml" -O "./api-$2.yaml" -q wget "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.docs/api-$2.yaml" -O "./swagger/api-$2.yaml" -q
} }
function generate () { function generate () {
echo "... generate python api" echo "... generate python api"
java -jar swagger-codegen-cli.jar generate -i "./api-$1.yaml" -l python -o "./api-$1" > /dev/null java -jar swagger-codegen-cli.jar generate -i "./swagger/api-$1.yaml" -l python -o "./swagger/api-$1" > /dev/null
} }
function remove () { function remove () {
echo "... removing old python api" echo "... removing old python api"
rm -rf "./api/api_$1" rm -rf "./swagger/api/api_$1"
} }
function copy () { function copy () {
#echo "... copying python api" #echo "... copying python api"
#cp -r "./api-$1/swagger_client" "./api/api_$1" #cp -r "./api-$1/swagger_client" "./api/api_$1"
cp "./api-$1.yaml" "./$1/api.yaml" echo "... copy the swagger docs"
cp -r ../dist/* "./$1" cp "./swagger/api-$1.yaml" "./swagger/$1/api.yaml"
cp -r ./dist/* "./swagger/$1"
} }
function replace () { function replace () {
echo "... replacing swagger client package name and gateway" echo "... replacing swagger client package name and gateway"
find "./api/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; find "./swagger/api/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \;
find "./api/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; find "./swagger/api/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \;
} }
function move () { function move () {
echo "... moving swagger static files" echo "... moving swagger static files"
mkdir -p ../site/swagger mkdir -p ./site/swagger
cp -r "./$1" ../site/swagger cp -r "./swagger/$1" ./site/swagger
} }
for key in "${!services[@]}"; do for key in "${!services[@]}"; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment