Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Chill-project
Chill-Report
Commits
8ebacb22
Commit
8ebacb22
authored
Nov 20, 2016
by
Julien Fastré
Browse files
adding step to deploy to packagist
parent
b396826d
Pipeline
#9758
failed with stages
in 4 minutes and 43 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
8ebacb22
services
:
-
chill/database:latest
before_script
:
-
composer config github-oauth.github.com $GITHUB_TOKEN
-
composer install --no-interaction
-
cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml
-
php Tests/Fixtures/App/app/console --env=test cache:warmup
-
php Tests/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
-
php Tests/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
.test_definition
:
&test_definition
services
:
-
chill/database:latest
before_script
:
-
composer config github-oauth.github.com $GITHUB_TOKEN
-
composer install --no-interaction
-
cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml
-
php Tests/Fixtures/App/app/console --env=test cache:warmup
-
php Tests/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
-
php Tests/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
test:php-5.6:
stage
:
test
script
:
phpunit
stage
:
test
image
:
chill/ci-image:php-5.6
<<
:
*test_definition
script
:
phpunit
test:php-7:
stage
:
test
script
:
phpunit
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment