Skip to content

Commit d97e615

Browse files
author
Matthieu Nogatchewsky
committed
Correction of ssh section & adding satis section
1 parent cd2d6d7 commit d97e615

File tree

3 files changed

+103
-76
lines changed

3 files changed

+103
-76
lines changed

docs/credentials-authentication/ssh.md

Lines changed: 21 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ First, simply go to the *Build Settings* of your pipeline configuration and ente
1818
Using SSH Keys to authenticate, you can use private repositories from *Bitbucket* or *Gitlab* as dependencies in *Composer*. Here
1919
is an example of how to configure *Composer*:
2020

21+
```
22+
{
23+
"name": "continuousphp/my-application",
24+
"homepage": "https://my-application.com/",
25+
"require": {
26+
"php": ">=5.6",
27+
"continuousphp/my-private-dependency": "~1.0.0"
28+
},
29+
"repositories": [
30+
{
31+
"type": "vcs",
32+
"url": "[email protected]:continuousphp/my-private-dependency.git"
33+
}
34+
]
35+
}
36+
```
37+
38+
If your library belongs to the same git provider as the one of your project, you need to set your composer.json. Here is an other example.
39+
2140
```
2241
{
2342
"name": "continuousphp/my-application",
@@ -34,6 +53,7 @@ is an example of how to configure *Composer*:
3453
]
3554
}
3655
```
56+
3757
Notice that despite of using directly your git provider url (i.e bitbucket.org, gitlab.com ...) as a hostname, we need to use a specific syntax *keyname-bb* where:
3858

3959
* ***keyname*** refers to the key name specified in your pipeline settings
@@ -49,9 +69,6 @@ The below table lists each prefix associated to git hosting services.
4969
<tr>
5070
<td>gh</td><td>github.com</td>
5171
</tr>
52-
<tr>
53-
<td>gl</td><td>gitlab.com</td>
54-
</tr>
5572
</table>
5673

5774

@@ -66,76 +83,4 @@ Then you can get the deploy key used by ContinuousPHP and add it to your library
6683

6784
In this way, you don't need to refer any keys in your pipeline settings.
6885

69-
70-
## Using private repositories from Satis
71-
72-
Using SSH Keys to authenticate, you can use your own Satis Proxy to install private dependencies with *Composer*. Let's create
73-
an example of how to mirror repositories with Satis and then use them with *Composer* :
74-
75-
### Satis Installation
76-
77-
We first need to install *Satis* :
78-
79-
```
80-
$ composer create-project composer/satis --stability=dev
81-
```
82-
83-
### Satis configuration
84-
85-
Once Satis is installed, create a Satis configuration file, e.g. `satis.json` :
86-
87-
```
88-
{
89-
"name": "My mirrored dependencies",
90-
"homepage": "http://my-satis-address.com",
91-
"repositories": [
92-
{
93-
"type": "vcs",
94-
"url": "[email protected]:continuousphp/repository-to-mirror-1.git"
95-
},
96-
{
97-
"type": "vcs",
98-
"url": "[email protected]:continuousphp/repository-to-mirror-2.git"
99-
}
100-
],
101-
"require-all": true,
102-
"require-dependencies": true,
103-
"archive": {
104-
"directory": "dist",
105-
"format": "tar",
106-
"skip-dev": true
107-
}
108-
}
109-
```
110-
111-
### Build the repositories
112-
113-
After creating the Satis configuration file, you need to tell Satis create the repositories :
114-
115-
```
116-
$ ./bin/satis build satis.json my-mirrored-dependencies/
117-
```
118-
119-
When this command finishes, we have a new directory `my-mirrored-dependencies` with two files: `packages.json` and `index.html`.
120-
`packages.json` will be read by *Composer* to determine what packages the repository offers.
121-
`index.html` is a static HTML file with information about the repository.
122-
It also contains the dist directory with all packages so they won’t have to be downloaded from GitHub anymore.
123-
124-
### Use Satis in Composer
125-
126-
To use our new Satis Proxy with *Composer* we have to include it in our `composer.json` like this :
127-
128-
```
129-
{
130-
"repositories": [
131-
{
132-
"type": "composer",
133-
"url": "http://my-satis-address.com"
134-
}
135-
],
136-
...
137-
}
138-
```
139-
140-
And that's it! When running `composer install`, *Composer* should now install your private dependencies directly from Satis.
141-
86+
If these solutions don't exactly match your needs, you could try to use Satis as explained in this [section](../satis.md).

docs/satis.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
layout: doc
3+
title: "Satis configuration - Documentation"
4+
category: "reference-guide"
5+
order: 2
6+
excerpt: "Satis configuration support by continuousphp"
7+
---
8+
9+
10+
## Using private repositories from Satis
11+
12+
Using SSH Keys to authenticate, you can use your own Satis Proxy to install private dependencies with *Composer*. Let's create
13+
an example of how to mirror repositories with Satis and then use them with *Composer* :
14+
15+
### Satis Installation
16+
17+
We first need to install *Satis* :
18+
19+
```
20+
$ composer create-project composer/satis --stability=dev
21+
```
22+
23+
### Satis configuration
24+
25+
Once Satis is installed, create a Satis configuration file, e.g. `satis.json` :
26+
27+
```
28+
{
29+
"name": "My mirrored dependencies",
30+
"homepage": "http://my-satis-address.com",
31+
"repositories": [
32+
{
33+
"type": "vcs",
34+
"url": "[email protected]:continuousphp/repository-to-mirror-1.git"
35+
},
36+
{
37+
"type": "vcs",
38+
"url": "[email protected]:continuousphp/repository-to-mirror-2.git"
39+
}
40+
],
41+
"require-all": true,
42+
"require-dependencies": true,
43+
"archive": {
44+
"directory": "dist",
45+
"format": "tar",
46+
"skip-dev": true
47+
}
48+
}
49+
```
50+
51+
### Build the repositories
52+
53+
After creating the Satis configuration file, you need to tell Satis create the repositories :
54+
55+
```
56+
$ ./bin/satis build satis.json my-mirrored-dependencies/
57+
```
58+
59+
When this command finishes, we have a new directory `my-mirrored-dependencies` with two files: `packages.json` and `index.html`.
60+
`packages.json` will be read by *Composer* to determine what packages the repository offers.
61+
`index.html` is a static HTML file with information about the repository.
62+
It also contains the dist directory with all packages so they won’t have to be downloaded from GitHub anymore.
63+
64+
### Use Satis in Composer
65+
66+
To use our new Satis Proxy with *Composer* we have to include it in our `composer.json` like this :
67+
68+
```
69+
{
70+
"repositories": [
71+
{
72+
"type": "composer",
73+
"url": "http://my-satis-address.com"
74+
}
75+
],
76+
...
77+
}
78+
```
79+
80+
And that's it! When running `composer install`, *Composer* should now install your private dependencies directly from Satis.
81+

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ nav:
8585
- Zend Server: deployment/zend-server.md
8686
- Reference guide:
8787
- Configure firewall & network: security/firewall.md
88+
- Configure Satis: satis.md
8889
- Packages & services overview: containers.md
8990
- Use specific containers:
9091
- SQL:

0 commit comments

Comments
 (0)