Use local cache (useless for user, usefull for CI)

This commit is contained in:
Jean-Baptiste Holcroft 2018-05-21 12:10:41 +02:00
parent b2f03c8675
commit 29c5f34170
3 changed files with 23 additions and 3 deletions

View file

@ -130,9 +130,18 @@ ynh_system_user_create "$app"
ynh_app_setting_set "$app" final_path "$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
#=================================================
# BUILD YARN DEPENDENCIES
#=================================================
cp ../conf/production.yaml "$final_path/config/production.yaml"
touch "$final_path/config/local-production.json"
(cd "$final_path" && yarn install --production --pure-lockfile)
(
cd "$final_path"
yarn install --production --pure-lockfile --cache-folder /var/cache/yarn/
)
#=================================================
# NGINX CONFIGURATION

View file

@ -130,7 +130,10 @@ ynh_restore_file "/etc/logrotate.d/$app"
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
(cd "$final_path" && yarn install --production --pure-lockfile)
(
cd "$final_path"
yarn install --production --pure-lockfile --cache-folder /var/cache/yarn/
)
# Set right permissions for curl install
chown -R "$app":"$app" "$datadir"

View file

@ -103,6 +103,10 @@ ynh_install_app_dependencies postgresql ffmpeg redis-server redis-tools mailutil
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path "$path_url")
#=================================================
# DOWNLOAD, CHECK AND UNPACK PEERTUBE SOURCE
#=================================================
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
cp ../conf/production.yaml "$final_path/config/production.yaml"
@ -112,7 +116,11 @@ cp -a "$tmpdir/local-production.json" "$final_path/config/local-production.json
# Remove the tmp directory securely
ynh_secure_remove "$tmpdir"
(cd "$final_path" && yarn install --production --pure-lockfile)
(
cd "$final_path"
yarn install --production --pure-lockfile --cache-folder /var/cache/yarn/
)
#=================================================