aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-11-13 14:31:31 +0100
committerRigel Kent <sendmemail@rigelk.eu>2018-11-13 14:31:48 +0100
commit1d859b5afa88583dc27027fe14d0aa13e24a44a3 (patch)
tree02acab355c64c9debf2c17606b363035a76f23ec
parent408f50ebc7cc3c0887d1e77a5c04508517dc151e (diff)
downloadPeerTube-1d859b5afa88583dc27027fe14d0aa13e24a44a3.tar.gz
PeerTube-1d859b5afa88583dc27027fe14d0aa13e24a44a3.tar.zst
PeerTube-1d859b5afa88583dc27027fe14d0aa13e24a44a3.zip
sync API version with PeerTube version and auto-update it via git hooks
-rw-r--r--package.json2
-rwxr-xr-xscripts/openapi-peertube-version.sh4
-rw-r--r--support/doc/api/openapi.yaml2
3 files changed, 6 insertions, 2 deletions
diff --git a/package.json b/package.json
index bc514920d..3c77b93cb 100644
--- a/package.json
+++ b/package.json
@@ -71,7 +71,7 @@
71 }, 71 },
72 "husky": { 72 "husky": {
73 "hooks": { 73 "hooks": {
74 "pre-commit": "lint-staged" 74 "pre-commit": "lint-staged && ./scripts/openapi-peertube-version.sh"
75 } 75 }
76 }, 76 },
77 "lint-staged": { 77 "lint-staged": {
diff --git a/scripts/openapi-peertube-version.sh b/scripts/openapi-peertube-version.sh
new file mode 100755
index 000000000..c638291f6
--- /dev/null
+++ b/scripts/openapi-peertube-version.sh
@@ -0,0 +1,4 @@
1# Version key/value should be on his own line
2PACKAGE_VERSION=$(node -p "require('./package.json').version")
3
4sed -i "s/\(^\s*\)version: .*/\1version: $PACKAGE_VERSION/" support/doc/api/openapi.yaml
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 59ca8b29a..f3520a7b1 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -1,7 +1,7 @@
1swagger: '2.0' 1swagger: '2.0'
2info: 2info:
3 title: PeerTube 3 title: PeerTube
4 version: 1.0.0-beta 4 version: 1.1.0-alpha.2
5 description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. 5 description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.
6host: peertube.example.com 6host: peertube.example.com
7securityDefinitions: 7securityDefinitions: