Installing a custom composer package from GitLab

I created a simple test wordpress plugin. The plugin consists of one php file (kreplach.php) and composer.json:

kreplach.php

<?php
    /*
    Plugin Name: kreplach
    Plugin URI: http://gitlab.example.com/sales/kreplach
    Description: just a test
    Author: Foo Bartok
    Version: 1.0
    Author URI: http://example.com
    */
?>

composer.json

{
    "license": "MIT",
    "name": "sales/kreplach",
    "type": "wordpress-plugin",
    "description": "just a test",
    "authors": [
        {
            "name": "Foo Bartok",
            "email": "foo@example.com",
            "homepage": "example.com"
        }
    ],
    "require": {
        "composer/installers": "*"
    }
}

On my dev server I have the following composer.json

Server composer.json

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://wpackagist.org"
        },
        {
            "type": "vcs",
            "url": "git@gitlab.example.com:sales/kreplach.git"
        }
    ],
    "require": {
        "php": ">=5.4",
        "wpackagist-plugin/akismet": "*",
        "wpackagist-plugin/contact-form-7": "*",
        "wpackagist-plugin/wordpress-importer": "*",
        "sales/kreplach": "master",
        "johnpbloch/wordpress": "4.*",
        "composer/installers": "*"
    },
    "extra": {
        "wordpress-install-dir": "wp"
    }
}

What I think MUST happen:

  • Composer browses git repository for composer.json
  • The composer matches the name "sales / kreplach" found in the composer.json layout builder
  • The composer copies the contents of the main branch to wp-content/plugins/kreplachon my build host.
  • My fake plugin does nothing as it was designed.

What is actually going on:

Bitter, bitter failure.

Loading composer repositories with package information Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package sales/kreplach could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
     see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I tested repo cloning sales/kreplachon the same host, I am trying to install a plugin.

, composer.json git, (, , ), ", json , Foam Head" .

gitlab - omnibus edition 8.6.4 ( ​​).

pip/ .txt, python, . - - ( ) ?

+4
1

gitlab, Bitbucket GitHub.

"sales/kreplach": "dev-master" composer.json - , "dev -".

-, Composer GitHub BitBucket, Gitlab... git , vcs.

!

:

0

All Articles