Skip to content

Commit d47b8e5

Browse files
authored
docs: Update Brancher documentation
- Added example for the `--label` option - Added example for the `--clear-services` option - Added `clear_services` setting to Hypernode Deploy example - Replaced some occurences of "Hypernode-deploy" with "Hypernode Deploy" - Replaced occurences of `testalex` with `example` - Replaced some occurences of `appname` with `example`
1 parent 206efad commit d47b8e5

File tree

1 file changed

+42
-20
lines changed

1 file changed

+42
-20
lines changed

docs/hypernode-platform/tools/hypernode-brancher.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ The appname specified in the request url is the appname on which the Brancher no
100100

101101
Once the Brancher node becomes available, you can control it via the `/v2/app/<appname>-eph123456` endpoint just like a regular Hypernode.
102102

103-
### Hypernode-deploy
103+
### Hypernode Deploy
104104

105-
Hypernode-deploy is our recommended way of deploying your webshop to Hypernode. which makes it easier for you to manage your application’s codebase. This platform is fully integrated with Hypernode Brancher, which makes it a breeze for you to try out upgrade scenarios, or pushes to the Staging environment.
105+
Hypernode Deploy is our recommended way of deploying your webshop to Hypernode. which makes it easier for you to manage your application’s codebase. This platform is fully integrated with Hypernode Brancher, which makes it a breeze for you to try out upgrade scenarios, or pushes to the Staging environment.
106106

107-
Once you set up your Hypernode to make use of Hypernode-deploy, you can run your tests against a Brancher node with just a single command. This will then run against your fresh Branched version of the Node, making sure that your tests are passing before deploying to production.
107+
Once you set up your Hypernode to make use of Hypernode Deploy, you can run your tests against a Brancher node with just a single command. This will then run against your fresh Branched version of the Node, making sure that your tests are passing before deploying to production.
108108

109-
You can use Brancher in your Hypernode-deploy deploy.php file like this:
109+
You can use Brancher in your Hypernode Deploy `deploy.php` file like this:
110110

111111
```php
112112
<?php
@@ -120,51 +120,73 @@ $testStage = $configuration->addStage('test', 'example.com');
120120
// We use an automatically created Brancher node based on the parent for the 'test' stage.
121121
// In your testing pipeline, you can simply use the 'test' stage to push changes to the Brancher server,
122122
// and run your tests. Cancel it when your tests fail or after your tests pass to incur minimal costs.
123-
$testStage->addBrancherServer('appname')
124-
->setSettings(['cron_enabled' => false, 'supervisor_enabled' => false]);
123+
$testStage->addBrancherServer('example')
124+
->setSettings(['clear_services' => ['cron', 'supervisor']);
125125
126126
return $configuration;
127127
```
128128

129-
This will automatically create a Brancher node based on the parent Hypernode and push to it, allowing you to test the changes before making them on the production Hypernode.
129+
This will automatically create a Brancher node based on the parent Hypernode and push to it, allowing you to test the changes before making them on the production Hypernode. In this example, we also clear services `cron` and `supervisor`, which means that the `cron` and `supervisor` configurations found on `example` will not be actively present on the Brancher instance.
130+
131+
```{note}
132+
There's an alias `hypernode-brancher` for the command `hypernode-systemctl brancher`, this might save you some keystrokes :).
133+
```
130134

131135
### Hypernode-systemctl brancher
132136

133-
You can use the command hypernode-systemctl brancher tool to quickly interact with the Hypernode API in a validated and controlled manner. Creating a Brancher node goes like this:
137+
You can use the command hypernode-systemctl brancher tool to quickly interact with the Hypernode API in a validated and controlled manner.
138+
139+
#### Creating a Brancher node
134140

135141
```console
136142
$ hypernode-systemctl brancher --create
137-
Brancher App created for app 'testalex'. See hypernode-systemctl brancher --list for the progress
138-
app_name: testalex-eph123456
139-
parent: testalex
140-
Host: testalex-eph123456.hypernode.io
143+
Brancher App created for app 'example'. See hypernode-systemctl brancher --list for the progress
144+
app_name: example-eph123456
145+
parent: example
146+
Host: example-eph123456.hypernode.io
147+
Labels: None
148+
Services with data to be cleared: cron
141149
IP: will become available in a couple of minutes
142150
```
143151

144-
You can then list the available Brancher nodes:
152+
In the above example you see the details of the created Brancher instance. The output also contains the given labels and services to be cleared, which have the respective defaults of `None` and `cron`.
153+
154+
To apply one or more label(s) to the Brancher instance, you can specify one or more `--label` options when creating the instance:
155+
156+
```console
157+
$ hypernode-systemctl brancher --create --label my_brancher_instance --label 'user=johndoe'
158+
```
159+
160+
To override the services that are cleared by default, pass the `--clear-services` option:
161+
162+
```console
163+
$ hypernode-systemctl brancher --create --clear-services cron elasticsearch mysql supervisor
164+
```
165+
166+
#### Listing available Brancher nodes
145167

146168
```console
147169
$ hypernode-systemctl brancher --list
148170
+--------------------+----------------+---------------------------------+---------+
149171
| Name | IP | Host | Minutes |
150172
+--------------------+----------------+---------------------------------+---------+
151-
| testalex-ephjopv59 | 83.217.88.80 | testalex-ephjopv59.hypernode.io | 4592 |
152-
| testalex-ephw4zcjr | 185.111.198.18 | testalex-ephw4zcjr.hypernode.io | 4345 |
153-
| testalex-ephsbuos6 | 37.72.165.123 | testalex-ephsbuos6.hypernode.io | 1866 |
173+
| example-ephjopv59 | 83.217.88.80 | example-ephjopv59.hypernode.io | 4592 |
174+
| example-ephw4zcjr | 185.111.198.18 | example-ephw4zcjr.hypernode.io | 4345 |
175+
| example-ephsbuos6 | 37.72.165.123 | example-ephsbuos6.hypernode.io | 1866 |
154176
+--------------------+----------------+---------------------------------+---------+
155177
```
156178

157-
Finally, you can delete it:
179+
#### Deleting a brancher node
158180

159181
```console
160182
$ hypernode-systemctl brancher --delete
161-
Brancher App 'testalex-eph123456' deleted. See hypernode-systemctl brancher --list for the list of remaining brancher apps.
183+
Brancher App 'example-eph123456' deleted. See hypernode-systemctl brancher --list for the list of remaining brancher apps.
162184
```
163185

164186
And with some creativity you can come up with a one-liner to remove all active Brancher nodes:
165187

166188
```console
167189
$ hypernode-systemctl brancher --list | awk '{print$2}' | grep -eph | xargs -n1 hypernode-systemctl brancher --delete
168-
Brancher App 'testalex-eph123456' deleted. See hypernode-systemctl brancher --list for the list of remaining brancher apps.
169-
Brancher App 'testalex-eph234567' deleted. See hypernode-systemctl brancher --list for the list of remaining brancher apps.
190+
Brancher App 'example-eph123456' deleted. See hypernode-systemctl brancher --list for the list of remaining brancher apps.
191+
Brancher App 'example-eph234567' deleted. See hypernode-systemctl brancher --list for the list of remaining brancher apps.
170192
```

0 commit comments

Comments
 (0)