adding apigen & publicaiton of api

This commit is contained in:
Julien Fastré 2016-12-12 22:18:03 +01:00
parent f4ec64c483
commit d5d88ca954
2 changed files with 47 additions and 0 deletions

View File

@ -10,6 +10,12 @@
- php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
- php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
stages:
- test
- deploy
- build-doc
- deploy-doc
test:php-5.6:
stage: test
<<: *test_definition
@ -30,3 +36,34 @@ 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

10
apigen.neon Normal file
View File

@ -0,0 +1,10 @@
# configuration for apigen
source:
- .
exclude:
- vendor/*
- Test*
title: Chill Activity Bundle