Merge pull request #1 from YunoHost/fix-enh-vuejs

fix use-git vuejs
This commit is contained in:
Axolotle 2021-01-18 18:25:55 +01:00 committed by GitHub
commit 9f71b934be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

25
ynh-dev
View file

@ -329,6 +329,13 @@ function use_git()
chown -R ynhdev /var/cache/ynh-dev/yunohost-admin/ chown -R ynhdev /var/cache/ynh-dev/yunohost-admin/
create_sym_link "/ynh-dev/yunohost-admin-vue/app/package.json" "/var/cache/ynh-dev/yunohost-admin/package.json" create_sym_link "/ynh-dev/yunohost-admin-vue/app/package.json" "/var/cache/ynh-dev/yunohost-admin/package.json"
create_sym_link "/ynh-dev/yunohost-admin-vue/app/package-lock.json" "/var/cache/ynh-dev/yunohost-admin/package-lock.json" create_sym_link "/ynh-dev/yunohost-admin-vue/app/package-lock.json" "/var/cache/ynh-dev/yunohost-admin/package-lock.json"
mv "/etc/nginx/conf.d/yunohost_admin.conf.inc" "/etc/nginx/conf.d/yunohost_admin.conf.inc.bkp"
trap 'on_exit' INT
on_exit()
{
mv "/etc/nginx/conf.d/yunohost_admin.conf.inc.bkp" "/etc/nginx/conf.d/yunohost_admin.conf.inc"
systemctl reload nginx
}
# create_sym_link "/ynh-dev/yunohost-admin-vue/app" "/usr/share/yunohost/admin" # create_sym_link "/ynh-dev/yunohost-admin-vue/app" "/usr/share/yunohost/admin"
cd /var/cache/ynh-dev/yunohost-admin/ cd /var/cache/ynh-dev/yunohost-admin/
@ -368,6 +375,24 @@ EOF
# Install dependencies # Install dependencies
npm ci --no-bin-links npm ci --no-bin-links
success "Now using Git repository for yunohost-admin" success "Now using Git repository for yunohost-admin"
cat <<EOF > /etc/nginx/conf.d/yunohost_admin.conf.inc
location /yunohost/admin {
proxy_pass https://localhost:8080/yunohost/admin;
proxy_redirect off;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host \$server_name;
proxy_set_header X-Forwarded-Port \$server_port;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
}
EOF
systemctl reload nginx
cd /ynh-dev/yunohost-admin-vue/app/ cd /ynh-dev/yunohost-admin-vue/app/
npm run serve npm run serve
;; ;;