Starting a private composer repository

Discuss installing Symfony 2 here

Moderators: dcobalt, tiagojsag

Starting a private composer repository

Postby goslund » Thu Jul 19, 2012 4:54 am

Hi! Quick question.. I've been scouring for a couple hours now and I can't find the answer to this, so I figured I'd ask. I'm trying to setup a private composer repository for some web tools that I am creating, and I can't seem to get the configuration right. Does anyone else do this, and if so can you help me out with a quick example?

Thanks,
Geoff
goslund
Junior Member
 
Posts: 7
Joined: Sun Sep 17, 2006 4:10 am
Location: Colorado

Re: Starting a private composer repository

Postby goslund » Fri Jul 20, 2012 12:24 am

Hi all.

That wasn't too hard once I got some shut-eye. I think the documentation at http://getcomposer.org/doc/05-repositories.md needs to be a little bit more clear. That goes for the Satis package as well.

What I was able to figure out finally was that you need to make a composer.json file in the satis installation directory (this was where I was having problems). Here is my config (frccore) as an example:

Code: Select all
{
    "name": "frccore",
    "homepage": "http://www.fatrobinconsulting.com",
    "repositories": [
        { "type": "vcs", "url":"ssh://geoff@fatrobinconsulting.com/home/geoff/repos/frccore-base-install.git" }
    ],
    "require-all": true
}


That's all.... then I ran the following
Code: Select all
geoff@www:~/composer/satis$ ./app/satis build frccore.json ../frccore


What this did was generate a package repository in ~/composer/frccore. This directory has the packages definition, as well as a composer index file. Before I was manually trying to create a packages.json and not getting anywhere ^_^.

once my repo was set up, everything else was like a normal composer file... I'll share a demo composer.json file from a project that references my repo:

Code: Select all
{
    "name": "frccore/mublogbundle",
    "description": "FRCCore MUBlogBundle...",
    "require": {
   "frccore/frccore-base-install": "dev-master"   
    }, "repositories": [
   {
      "packagist":false
   },
   {
      "type": "composer",
      "url": "http://repos.fatrobinconsulting.com"
   }
    ]
}


the biggest performance gain I've realized was not using packagist, but unfortunately if I want to install other packages (like symfony2) I'll -have- to use it... but hey it's a small price to pay for "composing" these things together. GREAT TOOL GUYS, THANK YOU!!!

ps I'm a Symfony2 fanboy!! ;)
goslund
Junior Member
 
Posts: 7
Joined: Sun Sep 17, 2006 4:10 am
Location: Colorado


Return to Installation and setup

Who is online

Users browsing this forum: No registered users and 2 guests