Name: composer-lock-docker
Owner: Pantheon
Description: Provides a "composer lock" service as a Python Flask app in a docker container.
Created: 2018-01-03 23:06:50.0
Updated: 2018-01-08 21:16:15.0
Pushed: 2018-01-05 05:30:27.0
Homepage: null
Size: 11
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Provides a “composer lock” service as a Python Flask app in a docker container.
To use the service, upload a composer.json
file to a specified endpoint
uri. The result will be the updated contents of the composer.lock
file.
Supported endpoints:
/update
: Runs a composer update
on the provided composer.json
file./update&project=org/name
: Runs composer update
on the specified project(s) only.Upload files:
composer-json
to supply the composer.json file (required).composer-lock
to supply an initial lock file (optional).Additional flags may be provided via curl:
prefer-source
prefer-dist
prefer-stable
dev
no-dev
with-dependencies
The following options are assumed:
--no-autoloader
--no-scripts
--no-interaction
--no-plugins
No other composer
options may be set when using this service.
make build
for local testing.This project has been registered on quay.io; push to the master branch to automatically update :latest for the container.
Start container:
cker run --rm -p 5000:5000 quay.io/pantheon-public/composer-lock
erving Flask app "main"
unning on http://0.0.0.0:5000/ (Press CTRL+C to quit)
Curl it:
rl localhost:5000
mposer lock service running on 85d3082ca94f
If you want to know the exact IP address of the local docker image, you can use:
docker-machine ip default
(assuming default
is the name of your docker-machine instance)
Use this if localhost
does not work for local testing.
See examples/kubernetes
directory for files. Customize to suit (optional),
then run:
examples/kubernetes
bectl apply -f deploy.yaml
bectl apply -f service.yaml
bectl get services composer-lock
Access the service via the address shown in the “External IP” column.
port COMPOSER_LOCK_SERVICE = composer-lock.example.com
ias composer=/path/to/composer-lock-docker/examples/scripts/composer
mposer update
Upload a composer.json
to get a composer.lock
back:
rl -F 'composer-json=@/path/to/project/composer.json' localhost:5000/update
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "c755802dc01c48c0f80de1866ba616c5",
"packages": [
{
Pass the 'prefer-source' option:
rl -F 'composer-json=@composer.json' -F 'prefer-source=1' localhost:5000/update
TODO: Provide an existing lock file, and update just one project with its dependencies:
rl \
'composer-json=@composer.json' \
'composer-lock=@composer.lock' \
'project=org/name' \
'with-dependencies=1' \
calhost:5000/update