diff --git a/Dockerfile b/Dockerfile index 6daa63c59c..159d453d64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -119,6 +119,7 @@ COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf # Add PHP Source Code COPY ./app /usr/share/nginx/html/app +COPY ./bin /usr/local/bin COPY ./docs /usr/share/nginx/html/docs COPY ./public /usr/share/nginx/html/public COPY ./src /usr/share/nginx/html/src @@ -136,13 +137,10 @@ RUN mkdir -p /storage/uploads && \ # Supervisord Conf COPY ./docker/supervisord.conf /etc/supervisord.conf -# Start -COPY ./docker/bin/start /start -RUN chmod 775 /start - -# Migrate -COPY ./docker/bin/migrate /migrate -RUN chmod 775 /migrate +# Executables +RUN chmod +x /usr/local/bin/start +RUN chmod +x /usr/local/bin/migrate +RUN chmod +x /usr/local/bin/test # Letsencrypt Permissions RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ @@ -151,4 +149,4 @@ EXPOSE 80 WORKDIR /usr/share/nginx/html -CMD ["/bin/bash", "/start"] +CMD ["/bin/bash", "/usr/local/bin/start"] diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index 2b6aff80c4..e05d1bc0ff 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -21,7 +21,7 @@ $callbacks = [ }, '0.5.0' => function($project) use ($db, $projectDB, $requset) { - Console::info('Upgrading project: '.$project->getId()); + Console::log('Migrating project: '.$project->getId()); // Update all documents $uid -> $id @@ -40,7 +40,7 @@ $callbacks = [ $sum = count($all); - Console::success('Fetched '.$sum.' (offset: '.$offset.' / limit: '.$limit.') documents from a total of '.$projectDB->getSum()); + Console::log('Migrating: '.$offset.' / '.$projectDB->getSum()); foreach($all as $document) { $document = fixDocument($document); @@ -51,7 +51,6 @@ $callbacks = [ try { $new = $projectDB->overwriteDocument($document->getArrayCopy()); - Console::success('Updated document succefully'); } catch (\Throwable $th) { Console::error('Failed to update document: '.$th->getMessage()); continue; @@ -153,7 +152,7 @@ function fixDocument(Document $document) { ->removeAttribute('$uid') ; - Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId()); + //Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId()); foreach($document as &$attr) { if($attr instanceof Document) { @@ -211,7 +210,7 @@ $cli $sum = count($projects); $offset = $offset + $limit; - Console::success('Fetched '.$sum.' projects...'); + Console::log('Fetched '.$sum.' projects...'); } Console::success('Data Migration Completed'); diff --git a/docker/bin/migrate b/bin/migrate similarity index 100% rename from docker/bin/migrate rename to bin/migrate diff --git a/docker/bin/start b/bin/start similarity index 100% rename from docker/bin/start rename to bin/start diff --git a/bin/test b/bin/test new file mode 100644 index 0000000000..6471058562 --- /dev/null +++ b/bin/test @@ -0,0 +1,4 @@ + +#!/bin/bash + +/usr/share/nginx/html/vendor/bin/phpunit --configuration /usr/share/nginx/html/phpunit.xml \ No newline at end of file