1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/terraforming-mars_ynh.git synced 2024-09-03 20:36:05 +02:00

some fixes and install by commit version

This commit is contained in:
Thomas 2023-10-29 16:49:10 +01:00 committed by GitHub
parent ec278324ef
commit 5b61fb3dd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 35 deletions

View file

@ -7,6 +7,9 @@
# nodejs version # nodejs version
nodejs_version=16 nodejs_version=16
# Terraforming-mars commit
TM_version="a36d327"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================

View file

@ -19,19 +19,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Upgrade NPM # Upgrade NPM
ynh_npm install --global npm@6.14.18 ynh_npm install --global npm@6.14.18
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
#ynh_setup_source --dest_dir="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -48,7 +35,8 @@ ynh_add_nginx_config
#================================================= #=================================================
cd $install_dir cd $install_dir
git clone https://github.com/terraforming-mars/terraforming-mars.git ynh_exec_warn_less git clone https://github.com/terraforming-mars/terraforming-mars.git
git checkout $TM_version
pushd $install_dir/terraforming-mars pushd $install_dir/terraforming-mars
ynh_use_nodejs ynh_use_nodejs

View file

@ -30,35 +30,23 @@ ynh_npm install --global npm@6.14.18
#================================================= #=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full-replace=1
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# BUILD APP # BUILD APP
#================================================= #=================================================
ynh_script_progression --message="Building app... This may take quiete some time" --weight=30 ynh_script_progression --message="Building app... This may take quiete some time" --weight=30
pushd $install_dir cd $install_dir
ynh_exec_warn_less git clone https://github.com/terraforming-mars/terraforming-mars.git
git checkout $TM_version
pushd $install_dir/terraforming-mars
ynh_use_nodejs ynh_use_nodejs
ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_script_progression --message="npm install... This can be very long, be patient !" --weight=18
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000 ynh_exec_warn_less env $ynh_node_load_PATH $ynh_npm install --network-timeout=100000
ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build
ynh_script_progression --message="Cleaning cache... " --weight=3
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean 2>&1
ynh_script_progression --message="npm run build... This can be very long, be patient !" --weight=25
ynh_exec_warn_less env $ynh_node_load_PATH $ynh_npm run build
popd popd
chmod 750 "$install_dir" chmod 750 "$install_dir"