aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-15 11:10:46 +0100
committerChocobozzz <me@florianbigard.com>2018-01-15 11:28:41 +0100
commit6b2ef589ed8ef5d253f6213e1bb275cbe135f2b4 (patch)
tree78ca2afa162c9da0b4e013644f3a8c5b49e26436
parent633868bc2c638ab15c31513bc0da7de92944bffc (diff)
downloadPeerTube-6b2ef589ed8ef5d253f6213e1bb275cbe135f2b4.tar.gz
PeerTube-6b2ef589ed8ef5d253f6213e1bb275cbe135f2b4.tar.zst
PeerTube-6b2ef589ed8ef5d253f6213e1bb275cbe135f2b4.zip
Prepare production workflow
-rw-r--r--.gitignore10
-rw-r--r--client/package.json2
-rw-r--r--config/default.yaml16
-rw-r--r--config/production.yaml.example16
-rw-r--r--package.json4
-rwxr-xr-xscripts/release.sh30
-rw-r--r--server/helpers/requests.ts7
-rw-r--r--support/doc/production.md6
8 files changed, 57 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
index fa7974ae4..13f31db4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,15 +5,7 @@
5/test4/ 5/test4/
6/test5/ 6/test5/
7/test6/ 7/test6/
8/uploads/ 8/storage/
9/videos/
10/avatars/
11/thumbnails/
12/previews/
13/certs/
14/logs/
15/torrents/
16/cache/
17/config/production.yaml 9/config/production.yaml
18/ffmpeg/ 10/ffmpeg/
19/*.sublime-project 11/*.sublime-project
diff --git a/client/package.json b/client/package.json
index ad07f31b0..10634c3c4 100644
--- a/client/package.json
+++ b/client/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "peertube-client", 2 "name": "peertube-client",
3 "version": "0.0.1", 3 "version": "0.0.0-alpha",
4 "private": true, 4 "private": true,
5 "licence": "GPLv3", 5 "licence": "GPLv3",
6 "author": { 6 "author": {
diff --git a/config/default.yaml b/config/default.yaml
index 2c1043067..ee7446826 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -16,14 +16,14 @@ database:
16 16
17# From the project root directory 17# From the project root directory
18storage: 18storage:
19 avatars: 'avatars/' 19 avatars: 'storage/avatars/'
20 certs: 'certs/' 20 certs: 'storage/certs/'
21 videos: 'videos/' 21 videos: 'storage/videos/'
22 logs: 'logs/' 22 logs: 'storage/logs/'
23 previews: 'previews/' 23 previews: 'storage/previews/'
24 thumbnails: 'thumbnails/' 24 thumbnails: 'storage/thumbnails/'
25 torrents: 'torrents/' 25 torrents: 'storage/torrents/'
26 cache: 'cache/' 26 cache: 'storage/cache/'
27 27
28cache: 28cache:
29 previews: 29 previews:
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 404d35c16..660477196 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -17,14 +17,14 @@ database:
17 17
18# From the project root directory 18# From the project root directory
19storage: 19storage:
20 avatars: 'avatars/' 20 avatars: '../storage/avatars/'
21 certs: 'certs/' 21 certs: '../storage/certs/'
22 videos: 'videos/' 22 videos: '../storage/videos/'
23 logs: 'logs/' 23 logs: '../storage/logs/'
24 previews: 'previews/' 24 previews: '../storage/previews/'
25 thumbnails: 'thumbnails/' 25 thumbnails: '../storage/thumbnails/'
26 torrents: 'torrents/' 26 torrents: '../storage/torrents/'
27 cache: 'cache/' 27 cache: '../storage/cache/'
28 28
29cache: 29cache:
30 previews: 30 previews:
diff --git a/package.json b/package.json
index efe03dc04..213c6e7a6 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "name": "peertube", 2 "name": "peertube",
3 "description": "Prototype of a decentralized video streaming platform using P2P (bittorent) directly in the web browser with WebTorrent and Angular 2.", 3 "description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.",
4 "version": "0.0.1", 4 "version": "0.0.0-alpha",
5 "private": true, 5 "private": true,
6 "licence": "GPLv3", 6 "licence": "GPLv3",
7 "engines": { 7 "engines": {
diff --git a/scripts/release.sh b/scripts/release.sh
index 572e6bdca..07fec00b8 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -1,7 +1,33 @@
1#!/bin/bash 1#!/bin/bash
2 2
3npm run build 3shutdown() {
4npm test 4 # Get our process group id
5 PGID=$(ps -o pgid= $$ | grep -o [0-9]*)
6
7 # Kill it in a new new process group
8 setsid kill -- -$PGID
9 exit 0
10}
11
12trap "shutdown" SIGINT SIGTERM
13
14if [ -z "$1" ]; then
15 echo "Need version as argument"
16 exit -1
17fi
18
19cd ./client || exit -1
20npm version --no-git-tag-version --no-commit-hooks $1 || exit -1
21
22cd ../ || exit -1
23npm version -f --no-git-tag-version --no-commit-hooks $1 || exit -1
24
25git commit package.json client/package.json -m "Bumped to version $1" || exit -1
26git tag -s -a "v$1" -m "v$1"
27
28npm run build || exit -1
29#npm test || exit -1
5 30
6cd ../ || exit -1 31cd ../ || exit -1
32rm -f PeerTube/peertube.zip || exit -1
7zip -r PeerTube/peertube.zip PeerTube/{CREDITS.md,node_modules,FAQ.md,LICENSE,README.md,client/dist/,client/yarn.lock,client/package.json,config,dist,package.json,scripts,support,tsconfig.json,yarn.lock} 33zip -r PeerTube/peertube.zip PeerTube/{CREDITS.md,node_modules,FAQ.md,LICENSE,README.md,client/dist/,client/yarn.lock,client/package.json,config,dist,package.json,scripts,support,tsconfig.json,yarn.lock}
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index e8d77b15b..eb8a12868 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -1,8 +1,7 @@
1import * as Promise from 'bluebird' 1import * as Bluebird from 'bluebird'
2import { createWriteStream } from 'fs' 2import { createWriteStream } from 'fs'
3import * as request from 'request' 3import * as request from 'request'
4import { ACTIVITY_PUB } from '../initializers' 4import { ACTIVITY_PUB } from '../initializers'
5import Bluebird = require('bluebird')
6 5
7function doRequest ( 6function doRequest (
8 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean } 7 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }
@@ -12,13 +11,13 @@ function doRequest (
12 requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER 11 requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER
13 } 12 }
14 13
15 return new Promise<{ response: request.RequestResponse, body: any }>((res, rej) => { 14 return new Bluebird<{ response: request.RequestResponse, body: any }>((res, rej) => {
16 request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body })) 15 request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body }))
17 }) 16 })
18} 17}
19 18
20function doRequestAndSaveToFile (requestOptions: request.CoreOptions & request.UriOptions, destPath: string) { 19function doRequestAndSaveToFile (requestOptions: request.CoreOptions & request.UriOptions, destPath: string) {
21 return new Promise<request.RequestResponse>((res, rej) => { 20 return new Bluebird<request.RequestResponse>((res, rej) => {
22 request(requestOptions) 21 request(requestOptions)
23 .on('response', response => res(response as request.RequestResponse)) 22 .on('response', response => res(response as request.RequestResponse))
24 .on('error', err => rej(err)) 23 .on('error', err => rej(err))
diff --git a/support/doc/production.md b/support/doc/production.md
index 118704da3..a8ed2af88 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -199,6 +199,12 @@ Tell systemd to reload its config:
199sudo systemctl daemon-reload 199sudo systemctl daemon-reload
200``` 200```
201 201
202If you want to start PeerTube on boot:
203
204```
205sudo systemctl enabled peertube
206```
207
202### Run 208### Run
203 209
204``` 210```