forked from fescobar/allure-docker-service-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·43 lines (35 loc) · 1.12 KB
/
run.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.12 KB
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
#!/bin/bash
### API Prefix
API_URL_PREFIX="/allure-docker-service"
if [ -n "$ALLURE_DOCKER_PUBLIC_API_URL_PREFIX" ]; then
if [[ $ALLURE_DOCKER_PUBLIC_API_URL_PREFIX != /* ]]; then
ALLURE_DOCKER_PUBLIC_API_URL_PREFIX="/$ALLURE_DOCKER_PUBLIC_API_URL_PREFIX"
fi
API_URL_PREFIX="$ALLURE_DOCKER_PUBLIC_API_URL_PREFIX$API_URL_PREFIX"
fi
FULL_ALLURE_DOCKER_API_URL="$ALLURE_DOCKER_PUBLIC_API_URL$API_URL_PREFIX"
### UI Prefix
UI_URL_PREFIX="/allure-docker-service-ui"
if [ -n "$URL_PREFIX" ]; then
if [[ $URL_PREFIX != /* ]]; then
URL_PREFIX="/$URL_PREFIX"
fi
UI_URL_PREFIX="$URL_PREFIX$UI_URL_PREFIX"
fi
echo """ALLURE_DOCKER_API_URL=${FULL_ALLURE_DOCKER_API_URL}
ROUTER_BASE_NAME=${UI_URL_PREFIX}""" > $ROOT/.env
$ROOT/generate_env_file.sh
mv $ROOT/env-config.js $ROOT/ui
VERSION=$(cat $ROOT/ui/ui_version)
CONFIG_JSON=$(cat <<EOF
{
"version": "$VERSION",
"prefix": "$UI_URL_PREFIX",
"full_allure_docker_api_url": "$FULL_ALLURE_DOCKER_API_URL"
}
EOF
)
echo "ALLURE_UI_VERSION: $VERSION"
cat $ROOT/.env
echo $CONFIG_JSON > $ROOT/ui/config.json
URL_PREFIX="${URL_PREFIX}" node $ROOT/ui/server.js