pantheon-systems/composer-lock-docker

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

docker composer-lock service (flask app)

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:

Upload files:

Additional flags may be provided via curl:

The following options are assumed:

No other composer options may be set when using this service.

Build & Push

This project has been registered on quay.io; push to the master branch to automatically update :latest for the container.

Run local

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.

Run on Kubernetes

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.

Example client usage
port COMPOSER_LOCK_SERVICE = composer-lock.example.com
ias composer=/path/to/composer-lock-docker/examples/scripts/composer

mposer update
Example service usage

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.