add manual deployment scripts #96
Merged
maxime.batista
merged 1 commits from manual-deploy
into master
1 year ago
@ -0,0 +1,17 @@
|
|||||||||||||
|
|
||||||||||||
|
|||||||||||||
|
export OUTPUT=$1
|
||||||||||||
|
export BASE=$2
|
||||||||||||
|
|
||||||||||||
|
rm -rf $OUTPUT/*
|
||||||||||||
clement.freville2
commented 1 year ago
Review
Quote the variable as it may contain spaces. Also, if |
|||||||||||||
|
|
||||||||||||
|
echo "VITE_API_ENDPOINT=$BASE/api" >> .env.PROD
|
||||||||||||
|
echo "VITE_BASE=$BASE" >> .env.PROD
|
||||||||||||
clement.freville2
commented 1 year ago
Review
Just pass those as environment variables? They don't need to be in a file. |
|||||||||||||
|
|
||||||||||||
|
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
|
@ -4,6 +4,9 @@
|
|||||||||||||
// in an `ASSETS` array constant.
|
// in an `ASSETS` array constant.
|
||||||||||||
require __DIR__ . "/../views-mappings.php";
|
require __DIR__ . "/../views-mappings.php";
|
||||||||||||
|
|
||||||||||||
|
// THIS VALUE IS TO SET IN THE CI
|
||||||||||||
|
const BASE_PATH = null;
|
||||||||||||
clement.freville2
commented 1 year ago
Review
|
|||||||||||||
|
|
||||||||||||
const _SUPPORTS_FAST_REFRESH = false;
|
const _SUPPORTS_FAST_REFRESH = false;
|
||||||||||||
$database_file = __DIR__ . "/../database.sqlite";
|
$database_file = __DIR__ . "/../database.sqlite";
|
||||||||||||
$_data_source_name = "sqlite:/$database_file";
|
$_data_source_name = "sqlite:/$database_file";
|
||||||||||||
@ -23,3 +26,7 @@ function _asset(string $assetURI): string {
|
|||||||||||||
|
|
||||||||||||
|
|
||||||||||||
function _init_database(PDO $pdo): void {}
|
function _init_database(PDO $pdo): void {}
|
||||||||||||
|
|
||||||||||||
|
function _get_base_path(): string {
|
||||||||||||
|
return BASE_PATH;
|
||||||||||||
|
}
|
||||||||||||
|
@ -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
The shebang is missing.