Newer
Older
# tempaltes
.install_template: &installation
script:
# wait for service container
- while [ $(curl --head --silent http://$TARGET | grep -c "200 OK") == 0 ]; do sleep 2s; done
# upload package
- 'curl -X PUT -H "Content-Type: application/zip" --data-binary @$(ls build/*.xar) "http://admin:@$TARGET/exist/rest/db/openapi.xar"'
# install package
- 'curl -X GET "http://admin:@$TARGET/exist/rest/db/?_query=repo:install-and-deploy-from-db(''/db/openapi.xar'')"'
# check availabilty
# for debug use - 'curl --silent "http://$TARGET/exist/apps/openapi/openapi.json"'
- 'curl --silent "http://$TARGET/exist/apps/openapi/index.html" | grep "Swagger UI for OpenAPI for RESTXQ"' # swagger available
- 'curl --silent "http://$TARGET/exist/apps/openapi/openapi.json" | grep "OpenAPI for RESTXQ"' # openapi.json available
timeout: 5 minutes
# main CI instructions
image: docker.gitlab.gwdg.de/subugoe/openapi4restxq:latest
stages:
- build
- test
- deploy
build-develop:
except:
- ant test
artifacts:
paths:
- build/*.xar
- test/
services:
- name: existdb/existdb:latest
alias: existdb
variables:
TARGET: "existdb:8080"
<<: *installation
installation-fusion:
stage: test
except:
- tags
services:
- name: repo.evolvedbinary.com:9443/evolvedbinary/fusiondb-server:latest
alias: fusiondb
variables:
TARGET: "fusiondb:4059"
<<: *installation
- develop
except:
- tags
stage: deploy
script:
- FILENAME=$(ls build/*.xar)
- curl -u ci:${EXIST_UPLOAD_PW} -X POST -F file=@${FILENAME} https://ci.de.dariah.eu/exist-upload