add "deploy to packagist" stage during ci

This commit is contained in:
Julien Fastré 2016-11-17 22:29:40 +01:00
parent 961d942f38
commit 5ac623075d

View File

@ -1,18 +1,28 @@
services: .test_definition: &test_definition
- chill/database:latest services:
- chill/database:latest
before_script: before_script:
- composer config github-oauth.github.com $GITHUB_TOKEN - composer config github-oauth.github.com $GITHUB_TOKEN
- composer install --no-interaction - composer install --no-interaction
- cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml - cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml
- php Tests/Fixtures/App/app/console.php --env=test cache:warmup - php Tests/Fixtures/App/app/console.php --env=test cache:warmup
- php Tests/Fixtures/App/app/console.php doctrine:migrations:migrate --env=test --no-interaction - php Tests/Fixtures/App/app/console.php doctrine:migrations:migrate --env=test --no-interaction
- php Tests/Fixtures/App/app/console.php doctrine:fixtures:load --env=test --no-interaction - php Tests/Fixtures/App/app/console.php doctrine:fixtures:load --env=test --no-interaction
test:php-5.6: test:php-5.6:
stage: test stage: test
image: chill/ci-image:php-5.6
<<: *test_definition
script: phpunit script: phpunit
test:php-7: test:php-7:
image: chill/ci-image:php-7 image: chill/ci-image:php-7
stage: test stage: test
<<: *test_definition
script: phpunit script: phpunit
deploy-packagist:
stage: deploy
image: chill/ci-image:php-7
before_script: ~
script:
- curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_PATH.git\"}}"