-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·49 lines (38 loc) · 1.54 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# Author: Jakub Liput
# Copyright (C) 2024 ACK CYFRONET AGH
# This software is released under the MIT license cited in 'LICENSE.txt'
# Launches webserver simulating Onezone server that allows to open the custom front-page
# in its context.
set -e
REPO_PATH=/onezone-gui-custom-frontpage
PORT=8080
SITE_PATH=/site
USER_HTML_PATH=$1
if [ -z "${USER_HTML_PATH}" ]; then
USER_HTML_PATH=examples/egi-datahub
fi
HTML_PATH=${REPO_PATH}/${USER_HTML_PATH}
# Check if path with custom frontpage exists
ls ${HTML_PATH} > /dev/null
# Install Onezone mock webapp
mkdir -p ${SITE_PATH}/ozw
cp -r ${REPO_PATH}/mock-app ${SITE_PATH}/ozw/onezone
mkdir ${SITE_PATH}/ozw/onezone/assets
cd ${SITE_PATH}/ozw/onezone/assets
mkdir scripts
mkdir styles
curl "https://raw.githubusercontent.com/onedata/onezone-gui/refs/heads/develop/src/app/scripts/custom-frontpage-integration.js" > scripts/custom-frontpage-integration.js
curl "https://raw.githubusercontent.com/onedata/onezone-gui/refs/heads/develop/src/public/assets/styles/custom-frontpage.css" > styles/custom-frontpage.css
# Mount custom frontpage for development
mkdir -p ${SITE_PATH}/ozw/onezone/custom
cd ${SITE_PATH}/ozw/onezone/custom
ln -s ${HTML_PATH} frontpage
# Start web server for displaying the app with frontpage
cd ${SITE_PATH}
echo ""
echo "--------------------------------------------------------------------"
echo "Open the mock app: http://localhost:${PORT}/ozw/onezone/index.html"
echo "--------------------------------------------------------------------"
echo ""
http-server -p ${PORT} ${SITE_PATH}