Create a private repository for composer with Satis

Download Satis or clone it from the repository
git clone https://github.com/composer/satis.git

Access the folder satis just created and install the dependencies with composer
composer install

Configure to use the command satis, export the bin/ folder to the PATH or create a symbolic link
sudo ln -s /path/satis/bin/satis /usr/local/bin/satis

Create the JSON including your repositories information, for this example it will be privateRepos.json

{
 "name": "Private repository SSH (dnetix)",
 "homepage": "https://your_domain.com/",
 "repositories": [
 {
 "type": "vcs",
 "url": "git@bitbucket.org:dnetix/example.git"
 },
 {
 "type": "vcs",
 "url": "git@bitbucket.org:dnetix/example2.git"
 }
 ],
 "require-dependencies": true
}

Create a public web folder accesible from the homepage given, say that is /var/www/repository so you will construct the web page

Note that the URL needs accesible from the machines that will use the repository and it needs to have a valid SSL certificate, only works with https

Run the build command and it will create the necessary web files for it
satis build privateRepos.json /var/www/repository

It will prompt for access to those repositories so use the method you want

Add it to the each project’s composer.json to let know to composer that it needs to use also your private repository

"repositories": [
 {
 "type": "composer",
 "url": "https://your_domain.com"
 }
 ],

Now you can include your own with a composer require dnetix/example

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s