add manual deployment scripts
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
a3e38bded1
commit
87e73a3c5f
@ -0,0 +1,17 @@
|
||||
|
||||
export OUTPUT=$1
|
||||
export BASE=$2
|
||||
|
||||
rm -rf $OUTPUT/*
|
||||
|
||||
echo "VITE_API_ENDPOINT=$BASE/api" >> .env.PROD
|
||||
echo "VITE_BASE=$BASE" >> .env.PROD
|
||||
|
||||
ci/build_react.msh
|
||||
|
||||
mkdir -p $OUTPUT/profiles/
|
||||
|
||||
sed -E 's/\/\*PROFILE_FILE\*\/\s*".*"/"profiles\/prod-config-profile.php"/' config.php > $OUTPUT/config.php
|
||||
sed -E "s/const BASE_PATH = .*;/const BASE_PATH = \"$(sed s/\\//\\\\\\//g <<< "$BASE")\";/" profiles/prod-config-profile.php > $OUTPUT/profiles/prod-config-profile.php
|
||||
|
||||
cp -r vendor sql src public $OUTPUT
|
@ -0,0 +1,4 @@
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^.*$ ./index.php [NC,L,QSA]
|
@ -0,0 +1,4 @@
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^.*$ ./index.php [NC,L,QSA]
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* relative path of the public directory from the server's document root.
|
||||
*/
|
||||
function get_public_path(string $public_dir): string {
|
||||
// find the server path of the index.php file
|
||||
$basePath = substr($public_dir, strlen($_SERVER['DOCUMENT_ROOT']));
|
||||
|
||||
$basePathLen = strlen($basePath);
|
||||
if ($basePathLen == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
$c = $basePath[$basePathLen - 1];
|
||||
|
||||
if ($c == "/" || $c == "\\") {
|
||||
$basePath = substr($basePath, 0, $basePathLen - 1);
|
||||
}
|
||||
return $basePath;
|
||||
}
|
Loading…
Reference in new issue