mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
adding step to deploy to packagist
This commit is contained in:
parent
b396826d8e
commit
8ebacb22ac
@ -1,3 +1,4 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
|
||||
@ -11,7 +12,22 @@ before_script:
|
||||
|
||||
test:php-5.6:
|
||||
stage: test
|
||||
image: chill/ci-image:php-5.6
|
||||
<<: *test_definition
|
||||
script: phpunit
|
||||
test:php-7:
|
||||
stage: test
|
||||
image: chill/ci-image:php-7
|
||||
<<: *test_definition
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user