From 12cef8609fba3085a6e2fa4189ba70a70c93de47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 14 Dec 2016 16:13:13 +0100 Subject: [PATCH] publishing doc to public api --- .gitlab-ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ apigen.neon | 10 ++++++++++ 2 files changed, 48 insertions(+) create mode 100644 apigen.neon diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39b3dea65..6759e65b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,12 @@ - php Tests/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction - php Tests/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction +stages: + - test + - deploy + - build-doc + - deploy-doc + test:php-5.6: stage: test image: chill/ci-image:php-5.6 @@ -31,3 +37,35 @@ deploy-packagist: script: - STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}") - if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi + +# deploy documentation +api-doc-build: + stage: build-doc + environment: api-doc + image: chill/ci-image:php-7 + before_script: + - mkdir api-doc + script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME + artifacts: + paths: + - "api-doc/" + name: api + expire_in: '2h' + only: + - master + - tags + +api-doc-deploy: + stage: deploy-doc + image: pallet/swiftclient:latest + before_script: + # test that CONTAINER_API variable is set + - if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi + # go to api-doc to have and url with PROJECT/BUILD + - cd api-doc + # upload, and keep files during 1 year + script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME" + only: + - master + - tags + diff --git a/apigen.neon b/apigen.neon new file mode 100644 index 000000000..42552e9f5 --- /dev/null +++ b/apigen.neon @@ -0,0 +1,10 @@ +# configuration for apigen + +source: + - . + +exclude: + - vendor/* + - Test* + +title: Chill Report Bundle