Prepare production workflow
This commit is contained in:
parent
633868bc2c
commit
6b2ef589ed
|
@ -5,15 +5,7 @@
|
||||||
/test4/
|
/test4/
|
||||||
/test5/
|
/test5/
|
||||||
/test6/
|
/test6/
|
||||||
/uploads/
|
/storage/
|
||||||
/videos/
|
|
||||||
/avatars/
|
|
||||||
/thumbnails/
|
|
||||||
/previews/
|
|
||||||
/certs/
|
|
||||||
/logs/
|
|
||||||
/torrents/
|
|
||||||
/cache/
|
|
||||||
/config/production.yaml
|
/config/production.yaml
|
||||||
/ffmpeg/
|
/ffmpeg/
|
||||||
/*.sublime-project
|
/*.sublime-project
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "peertube-client",
|
"name": "peertube-client",
|
||||||
"version": "0.0.1",
|
"version": "0.0.0-alpha",
|
||||||
"private": true,
|
"private": true,
|
||||||
"licence": "GPLv3",
|
"licence": "GPLv3",
|
||||||
"author": {
|
"author": {
|
||||||
|
|
|
@ -16,14 +16,14 @@ database:
|
||||||
|
|
||||||
# From the project root directory
|
# From the project root directory
|
||||||
storage:
|
storage:
|
||||||
avatars: 'avatars/'
|
avatars: 'storage/avatars/'
|
||||||
certs: 'certs/'
|
certs: 'storage/certs/'
|
||||||
videos: 'videos/'
|
videos: 'storage/videos/'
|
||||||
logs: 'logs/'
|
logs: 'storage/logs/'
|
||||||
previews: 'previews/'
|
previews: 'storage/previews/'
|
||||||
thumbnails: 'thumbnails/'
|
thumbnails: 'storage/thumbnails/'
|
||||||
torrents: 'torrents/'
|
torrents: 'storage/torrents/'
|
||||||
cache: 'cache/'
|
cache: 'storage/cache/'
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
previews:
|
previews:
|
||||||
|
|
|
@ -17,14 +17,14 @@ database:
|
||||||
|
|
||||||
# From the project root directory
|
# From the project root directory
|
||||||
storage:
|
storage:
|
||||||
avatars: 'avatars/'
|
avatars: '../storage/avatars/'
|
||||||
certs: 'certs/'
|
certs: '../storage/certs/'
|
||||||
videos: 'videos/'
|
videos: '../storage/videos/'
|
||||||
logs: 'logs/'
|
logs: '../storage/logs/'
|
||||||
previews: 'previews/'
|
previews: '../storage/previews/'
|
||||||
thumbnails: 'thumbnails/'
|
thumbnails: '../storage/thumbnails/'
|
||||||
torrents: 'torrents/'
|
torrents: '../storage/torrents/'
|
||||||
cache: 'cache/'
|
cache: '../storage/cache/'
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
previews:
|
previews:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "peertube",
|
"name": "peertube",
|
||||||
"description": "Prototype of a decentralized video streaming platform using P2P (bittorent) directly in the web browser with WebTorrent and Angular 2.",
|
"description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.0-alpha",
|
||||||
"private": true,
|
"private": true,
|
||||||
"licence": "GPLv3",
|
"licence": "GPLv3",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -1,7 +1,33 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
npm run build
|
shutdown() {
|
||||||
npm test
|
# Get our process group id
|
||||||
|
PGID=$(ps -o pgid= $$ | grep -o [0-9]*)
|
||||||
|
|
||||||
|
# Kill it in a new new process group
|
||||||
|
setsid kill -- -$PGID
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
trap "shutdown" SIGINT SIGTERM
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Need version as argument"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ./client || exit -1
|
||||||
|
npm version --no-git-tag-version --no-commit-hooks $1 || exit -1
|
||||||
|
|
||||||
cd ../ || exit -1
|
cd ../ || exit -1
|
||||||
|
npm version -f --no-git-tag-version --no-commit-hooks $1 || exit -1
|
||||||
|
|
||||||
|
git commit package.json client/package.json -m "Bumped to version $1" || exit -1
|
||||||
|
git tag -s -a "v$1" -m "v$1"
|
||||||
|
|
||||||
|
npm run build || exit -1
|
||||||
|
#npm test || exit -1
|
||||||
|
|
||||||
|
cd ../ || exit -1
|
||||||
|
rm -f PeerTube/peertube.zip || exit -1
|
||||||
zip -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}
|
zip -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}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import * as Promise from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { createWriteStream } from 'fs'
|
import { createWriteStream } from 'fs'
|
||||||
import * as request from 'request'
|
import * as request from 'request'
|
||||||
import { ACTIVITY_PUB } from '../initializers'
|
import { ACTIVITY_PUB } from '../initializers'
|
||||||
import Bluebird = require('bluebird')
|
|
||||||
|
|
||||||
function doRequest (
|
function doRequest (
|
||||||
requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }
|
requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }
|
||||||
|
@ -12,13 +11,13 @@ function doRequest (
|
||||||
requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER
|
requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise<{ response: request.RequestResponse, body: any }>((res, rej) => {
|
return new Bluebird<{ response: request.RequestResponse, body: any }>((res, rej) => {
|
||||||
request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body }))
|
request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body }))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function doRequestAndSaveToFile (requestOptions: request.CoreOptions & request.UriOptions, destPath: string) {
|
function doRequestAndSaveToFile (requestOptions: request.CoreOptions & request.UriOptions, destPath: string) {
|
||||||
return new Promise<request.RequestResponse>((res, rej) => {
|
return new Bluebird<request.RequestResponse>((res, rej) => {
|
||||||
request(requestOptions)
|
request(requestOptions)
|
||||||
.on('response', response => res(response as request.RequestResponse))
|
.on('response', response => res(response as request.RequestResponse))
|
||||||
.on('error', err => rej(err))
|
.on('error', err => rej(err))
|
||||||
|
|
|
@ -199,6 +199,12 @@ Tell systemd to reload its config:
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you want to start PeerTube on boot:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo systemctl enabled peertube
|
||||||
|
```
|
||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue