1
0
Fork 0

Use npm run install-node-dependencies

Instead of yarn, so we can move to another package manager in the future
This commit is contained in:
Chocobozzz 2025-02-18 13:42:38 +01:00
parent 70dae47f08
commit 29f55e9115
No known key found for this signature in database
GPG key ID: 583A612D890159BE
7 changed files with 13 additions and 14 deletions

View file

@ -84,7 +84,7 @@ yarn install --pure-lockfile
Note that development is done on the `develop` branch. If you want to hack on Note that development is done on the `develop` branch. If you want to hack on
PeerTube, you should switch to that branch. Also note that you have to repeat PeerTube, you should switch to that branch. Also note that you have to repeat
the `yarn install --pure-lockfile` command. the `npm run install-node-dependencies` command.
When you create a new branch you should also tell to use your repo for upload When you create a new branch you should also tell to use your repo for upload
not default one. To do just do: not default one. To do just do:

View file

@ -16,5 +16,5 @@ tasks:
before: export NODE_CONFIG="{\"import\":{\"videos\":{\"torrent\":{\"enabled\":false}}},\"webserver\":{\"hostname\":\"$(gp url 3000 | cut -d/ -f3)\",\"port\":\"443\",\"https\":true}}" before: export NODE_CONFIG="{\"import\":{\"videos\":{\"torrent\":{\"enabled\":false}}},\"webserver\":{\"hostname\":\"$(gp url 3000 | cut -d/ -f3)\",\"port\":\"443\",\"https\":true}}"
init: > init: >
psql -h localhost -d postgres --file=support/docker/gitpod/setup_postgres.sql && psql -h localhost -d postgres --file=support/docker/gitpod/setup_postgres.sql &&
yarn install --pure-lockfile npm run install-node-dependencies
command: npm run build:server && npm run dev command: npm run build:server && npm run dev

View file

@ -78,8 +78,7 @@ RELEASE_PAGE_URL="https://github.com/Chocobozzz/PeerTube/releases/tag/${VERSION}
LATEST_VERSION_DIRECTORY="$PEERTUBE_PATH/versions/peertube-${VERSION}" LATEST_VERSION_DIRECTORY="$PEERTUBE_PATH/versions/peertube-${VERSION}"
cd "$LATEST_VERSION_DIRECTORY" cd "$LATEST_VERSION_DIRECTORY"
# Launch yarn to check if we have all required dependencies NOCLIENT=1 npm run install-node-dependencies -- --production
NOCLIENT=1 yarn install --production --pure-lockfile
OLD_VERSION_DIRECTORY=$(readlink "$PEERTUBE_PATH/peertube-latest") OLD_VERSION_DIRECTORY=$(readlink "$PEERTUBE_PATH/peertube-latest")

View file

@ -110,7 +110,7 @@ sudo yum update
sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7 sudo yum install nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git devtoolset-7
``` ```
5. You need to use a more up to date version of G++ in order to run the yarn install command, hence the installation of devtoolset-7. 5. You need to use a more up to date version of G++ in order to run the `npm run install-node-dependencies` command, hence the installation of devtoolset-7.
```sh ```sh
sudo scl enable devtoolset-7 bash sudo scl enable devtoolset-7 bash
@ -119,7 +119,7 @@ sudo scl enable devtoolset-7 bash
Later when you invoke any node command, please prefix them with `CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++`, such as with: Later when you invoke any node command, please prefix them with `CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++`, such as with:
```sh ```sh
sudo -H -u peertube CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++ yarn install --production --pure-lockfile sudo -H -u peertube CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++ npm run install-node-dependencies -- --production
``` ```
6. Initialize the PostgreSQL database: 6. Initialize the PostgreSQL database:

View file

@ -8,12 +8,12 @@
* Check migrations: * Check migrations:
``` ```
npm run clean:server:test npm run clean:server:test
git checkout master && rm -r ./node_modules && yarn install --pure-lockfile && npm run build:server git checkout master && rm -r ./node_modules && npm run install-node-dependencies && npm run build:server
NODE_APP_INSTANCE=6 NODE_ENV=test node dist/server --benchmark-startup NODE_APP_INSTANCE=6 NODE_ENV=test node dist/server --benchmark-startup
git checkout develop && rm -r ./node_modules && yarn install --pure-lockfile && npm run build:server git checkout develop && rm -r ./node_modules && npm run install-node-dependencies && npm run build:server
NODE_APP_INSTANCE=6 NODE_ENV=test node dist/server --benchmark-startup NODE_APP_INSTANCE=6 NODE_ENV=test node dist/server --benchmark-startup
``` ```
* Run `rm -rf node_modules && rm -rf client/node_modules && yarn install --pure-lockfile && npm run build` to see if all the supported languages compile correctly * Run `rm -rf node_modules && rm -rf client/node_modules && npm run install-node-dependencies && npm run build` to see if all the supported languages compile correctly
* Update https://peertube2.cpy.re and check it works correctly * Update https://peertube2.cpy.re and check it works correctly
* Check CI tests are green * Check CI tests are green
* Run BrowserStack **and** local E2E tests * Run BrowserStack **and** local E2E tests

View file

@ -95,7 +95,7 @@ Install Peertube:
```bash ```bash
cd /var/www/peertube cd /var/www/peertube
sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile cd ./peertube-latest && sudo -H -u peertube npm run install-node-dependencies -- --production
``` ```
### :wrench: PeerTube configuration ### :wrench: PeerTube configuration
@ -336,7 +336,7 @@ Install node dependencies:
```bash ```bash
cd /var/www/peertube/versions/peertube-${VERSION} && \ cd /var/www/peertube/versions/peertube-${VERSION} && \
sudo -H -u peertube yarn install --production --pure-lockfile sudo -H -u peertube npm run install-node-dependencies -- --production
``` ```
Copy new configuration defaults values and update your configuration file: Copy new configuration defaults values and update your configuration file:

View file

@ -29,14 +29,14 @@ USER peertube
# Install manually client dependencies to apply our network timeout option # Install manually client dependencies to apply our network timeout option
RUN if [ "${ALREADY_BUILT}" = 0 ]; then \ RUN if [ "${ALREADY_BUILT}" = 0 ]; then \
cd client && yarn install --pure-lockfile --network-timeout 1200000 && cd ../ \ cd client && npm run install-node-dependencies -- --network-timeout 1200000 && cd ../ \
&& yarn install --pure-lockfile --network-timeout 1200000 \ && npm run install-node-dependencies -- --network-timeout 1200000 \
&& npm run build; \ && npm run build; \
else \ else \
echo "Do not build application inside Docker because of ALREADY_BUILT build argument"; \ echo "Do not build application inside Docker because of ALREADY_BUILT build argument"; \
fi; \ fi; \
rm -rf ./node_modules ./client/node_modules ./client/.angular \ rm -rf ./node_modules ./client/node_modules ./client/.angular \
&& NOCLIENT=1 yarn install --pure-lockfile --production --network-timeout 1200000 --network-concurrency 20 \ && NOCLIENT=1 npm run install-node-dependencies -- --production --network-timeout 1200000 --network-concurrency 20 \
&& yarn cache clean && yarn cache clean
USER root USER root