deploy to packagist

This commit is contained in:
Julien Fastré 2018-09-10 11:02:51 +02:00
parent 0eccda06d6
commit d058748ed0
2 changed files with 31 additions and 0 deletions

25
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,25 @@
.test_definition: &test_definition
services:
- chill/database:latest
before_script:
- composer config github-oauth.github.com $GITHUB_TOKEN
- composer install
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
- php Resources/test/Fixtures/App/app/console --env=test cache:warmup
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
stages:
- deploy
deploy-packagist:
stage: deploy
image: chill/ci-image:php-7.2
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

6
CHANGELOG.md Normal file
View File

@ -0,0 +1,6 @@
Dev branches
============
- adding .gitlab-ci to upgrade automatically packagist (master)