adding deploy doc stage

This commit is contained in:
Julien Fastré 2016-12-14 16:20:55 +01:00
parent 8e6f2d4355
commit 7763bddc80
2 changed files with 16 additions and 14 deletions

View File

@ -11,10 +11,10 @@
stages:
- build-doc
- deploy-doc
- test
- deploy
- build-doc
- deploy-doc
@ -31,6 +31,18 @@ test:php-7:
image: chill/ci-image:php-7
script: phpunit
deploy-packagist:
stage: deploy
image: chill/ci-image:php-7
before_script:
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
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
@ -47,14 +59,4 @@ api-doc-build:
only:
- master
- tags
deploy-packagist:
stage: deploy
image: chill/ci-image:php-7
before_script:
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
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

View File

@ -6,7 +6,7 @@ source:
exclude:
- vendor/*
- Resource/test/*
- Resources/test/*
title: Chill EventBundle