Skip to content

Commit 5949f96

Browse files
authored
Merge pull request #30 from crowdsecurity/fix-release-process
fix release process
2 parents a041c0c + 3509b63 commit 5949f96

File tree

5 files changed

+74
-17
lines changed

5 files changed

+74
-17
lines changed

docs/api/ApiCache.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ The cache mecanism to store every decisions from LAPI/CAPI. Symfony Cache compon
1414
|[clear](#apicacheclear)||
1515
|[configure](#apicacheconfigure)|Configure this instance.|
1616
|[get](#apicacheget)|Request the cache for the specified IP.|
17-
|[prune](#apicacheprune)||
17+
|[prune](#apicacheprune)|Prune the cache (only when using PHP File System cache).|
1818
|[pullUpdates](#apicachepullupdates)|Used in stream mode only.|
19+
|[testConnection](#apicachetestconnection)|Test the connection to the cache system (Redis or Memcached).|
1920
|[warmUp](#apicachewarmup)|Used in stream mode only.|
2021

2122

@@ -124,10 +125,10 @@ Request the cache for the specified IP.
124125
**Description**
125126

126127
```php
127-
prune (void)
128+
public prune (void)
128129
```
129130

130-
131+
Prune the cache (only when using PHP File System cache).
131132

132133

133134

@@ -170,6 +171,36 @@ Used for the stream mode when we have to update the remediations list.
170171
<hr />
171172

172173

174+
### ApiCache::testConnection
175+
176+
**Description**
177+
178+
```php
179+
public testConnection (void)
180+
```
181+
182+
Test the connection to the cache system (Redis or Memcached).
183+
184+
185+
186+
**Parameters**
187+
188+
`This function has no parameters.`
189+
190+
**Return Values**
191+
192+
`void`
193+
194+
195+
**Throws Exceptions**
196+
197+
198+
`\BouncerException`
199+
> if the connection was not successful
200+
201+
<hr />
202+
203+
173204
### ApiCache::warmUp
174205

175206
**Description**

docs/api/Bouncer.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The main Class of this package. This is the first entry point of any PHP Bouncer
2121
|[getRemediationForIp](#bouncergetremediationforip)|Get the remediation for the specified IP. This method use the cache layer.|
2222
|[pruneCache](#bouncerprunecache)|This method prune the cache: it removes all the expired cache items.|
2323
|[refreshBlocklistCache](#bouncerrefreshblocklistcache)|Used in stream mode only.|
24+
|[testConnection](#bouncertestconnection)|Test the connection to the cache system (Redis or Memcached).|
2425
|[warmBlocklistCacheUp](#bouncerwarmblocklistcacheup)|Used in stream mode only.|
2526

2627

@@ -295,6 +296,36 @@ This method should be called periodically (ex: crontab) in a asynchronous way to
295296
<hr />
296297

297298

299+
### Bouncer::testConnection
300+
301+
**Description**
302+
303+
```php
304+
public testConnection (void)
305+
```
306+
307+
Test the connection to the cache system (Redis or Memcached).
308+
309+
310+
311+
**Parameters**
312+
313+
`This function has no parameters.`
314+
315+
**Return Values**
316+
317+
`void`
318+
319+
320+
**Throws Exceptions**
321+
322+
323+
`\BouncerException`
324+
> if the connection was not successful
325+
326+
<hr />
327+
328+
298329
### Bouncer::warmBlocklistCacheUp
299330

300331
**Description**

docs/api/RestClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Send an HTTP request using the file_get_contents and parse its JSON result if an
9090

9191

9292
`\BouncerException`
93-
> when the reponse status is not 2xx.
93+
> when the reponse status is not 2xx
9494
9595
<hr />
9696

scripts/publish-release.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,17 @@ elif [[ "$unamestr" == 'Darwin' ]]; then
1818
fi
1919
git_base_dir=`git rev-parse --show-toplevel`
2020

21-
# Update version everywhere (add and commit changes)
21+
# Update version everywhere (add and commit changes), tag and release
22+
git checkout main
2223
if [[ $platform == 'linux' ]]; then
23-
sed -i -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" `git rev-parse --show-toplevel`/src/Constants.php
24+
sed -i -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" $git_base_dir/src/Constants.php
2425
else
25-
sed -i "" -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" `git rev-parse --show-toplevel`/src/Constants.php
26+
sed -i "" -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" $git_base_dir/src/Constants.php
2627
fi
27-
git add `git rev-parse --show-toplevel`/src/Constants.php
28-
29-
3028
git add $git_base_dir/src/Constants.php
31-
git commit -m "bump version to $NEW_GIT_VERSION"
32-
git push
33-
echo "Note: new commit \"bump version to $NEW_GIT_VERSION\""
3429

35-
# Tag and release
36-
git checkout main
3730
git tag $NEW_GIT_VERSION
31+
git commit -m "bump version to $NEW_GIT_VERSION"
32+
git push
3833
git push origin $NEW_GIT_VERSION
3934
gh release create --draft $NEW_GIT_VERSION --title $NEW_GIT_VERSION

src/Bouncer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ public function checkCaptcha(string $expected, string $try, string $ip)
198198
}
199199

200200
/**
201-
* Test the connection to the cache system (Redis or Memcached)
202-
*
201+
* Test the connection to the cache system (Redis or Memcached).
202+
*
203203
* @throws BouncerException if the connection was not successful
204204
* */
205205
public function testConnection()

0 commit comments

Comments
 (0)