From 29c5f34170d50a55d52c7ebba56ea3f28cbb4062 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Mon, 21 May 2018 12:10:41 +0200 Subject: [PATCH] Use local cache (useless for user, usefull for CI) --- scripts/install | 11 ++++++++++- scripts/restore | 5 ++++- scripts/upgrade | 10 +++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 21a2c78..442f50c 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/restore b/scripts/restore index 42a8a16..8c74333 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index dcb9293..ae832c0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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/ +) #=================================================