Add automated dev setup using Gitpod
This commit is contained in:
parent
cda03765fe
commit
0cfcbae818
7 changed files with 53 additions and 4 deletions
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
|
@ -57,8 +57,8 @@ before you start working on them :).
|
||||||
|
|
||||||
First, you should use a server or PC with at least 4GB of RAM. Less RAM may lead to crashes.
|
First, you should use a server or PC with at least 4GB of RAM. Less RAM may lead to crashes.
|
||||||
|
|
||||||
Make sure that you have followed
|
Make sure that you have followed
|
||||||
[the steps](/support/doc/dependencies.md)
|
[the steps](/support/doc/dependencies.md)
|
||||||
to install the dependencies.
|
to install the dependencies.
|
||||||
|
|
||||||
Then clone the sources and install node modules:
|
Then clone the sources and install node modules:
|
||||||
|
@ -93,6 +93,12 @@ $ sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_dev
|
||||||
|
|
||||||
In dev mode, administrator username is **root** and password is **test**.
|
In dev mode, administrator username is **root** and password is **test**.
|
||||||
|
|
||||||
|
### Online development
|
||||||
|
|
||||||
|
You can get a complete PeerTube development setup with Gitpod, a free one-click online IDE for GitHub:
|
||||||
|
|
||||||
|
[](https://gitpod.io/#https://github.com/Chocobozzz/PeerTube)
|
||||||
|
|
||||||
### Server side
|
### Server side
|
||||||
|
|
||||||
You can find a documentation of the server code/architecture [here](/support/doc/development/server/code.md).
|
You can find a documentation of the server code/architecture [here](/support/doc/development/server/code.md).
|
||||||
|
|
16
.gitpod.yml
Normal file
16
.gitpod.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
image:
|
||||||
|
file: support/docker/gitpod/Dockerfile
|
||||||
|
ports:
|
||||||
|
- port: 3000
|
||||||
|
onOpen: open-preview
|
||||||
|
- port: 5432
|
||||||
|
onOpen: ignore
|
||||||
|
- port: 6379
|
||||||
|
onOpen: ignore
|
||||||
|
- port: 9000
|
||||||
|
onOpen: ignore
|
||||||
|
tasks:
|
||||||
|
- command: redis-server
|
||||||
|
- before: export NODE_CONFIG="{\"import\":{\"videos\":{\"torrent\":{\"enabled\":false}}},\"webserver\":{\"hostname\":\"$(gp url 3000 | cut -d/ -f3)\",\"port\":\"443\",\"https\":true}}"
|
||||||
|
init: yarn install --pure-lockfile
|
||||||
|
command: npm run dev
|
10
client/proxy.config.json
Normal file
10
client/proxy.config.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"/api": {
|
||||||
|
"target": "http://localhost:9000",
|
||||||
|
"secure": false
|
||||||
|
},
|
||||||
|
"/static": {
|
||||||
|
"target": "http://localhost:9000",
|
||||||
|
"secure": false
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
hmr: true,
|
hmr: true,
|
||||||
apiUrl: 'http://localhost:9000'
|
apiUrl: ''
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,4 @@ set -eu
|
||||||
|
|
||||||
cd client
|
cd client
|
||||||
|
|
||||||
npm run ng -- serve --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000
|
npm run ng -- serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000
|
||||||
|
|
11
support/docker/gitpod/Dockerfile
Normal file
11
support/docker/gitpod/Dockerfile
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
FROM gitpod/workspace-postgres
|
||||||
|
|
||||||
|
# Install PeerTube's dependencies.
|
||||||
|
RUN sudo apt-get update -q && sudo apt-get install -qy \
|
||||||
|
ffmpeg \
|
||||||
|
openssl \
|
||||||
|
redis-server
|
||||||
|
|
||||||
|
# Set up PostgreSQL.
|
||||||
|
COPY --chown=gitpod:gitpod setup_postgres.sql /tmp/
|
||||||
|
RUN pg_start && psql -h localhost -d postgres --file=/tmp/setup_postgres.sql
|
6
support/docker/gitpod/setup_postgres.sql
Normal file
6
support/docker/gitpod/setup_postgres.sql
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
create database peertube_dev;
|
||||||
|
create user peertube password 'peertube';
|
||||||
|
grant all privileges on database peertube_dev to peertube;
|
||||||
|
\c peertube_dev
|
||||||
|
CREATE EXTENSION pg_trgm;
|
||||||
|
CREATE EXTENSION unaccent;
|
Loading…
Add table
Reference in a new issue