Updated server commands

This commit is contained in:
Eldad Fux
2020-05-10 13:30:07 +03:00
parent ca52947203
commit 98b04976c1
4 changed files with 28 additions and 13 deletions
+1 -1
View File
@@ -30,4 +30,4 @@ install:
script:
- docker ps
- docker exec appwrite bash bin/test
- docker exec appwrite bash test
+5 -6
View File
@@ -119,7 +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/share/nginx/html/bin
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
@@ -138,10 +138,9 @@ RUN mkdir -p /storage/uploads && \
COPY ./docker/supervisord.conf /etc/supervisord.conf
# Executables
RUN chmod +x /usr/share/nginx/html/bin/start
RUN chmod +x /usr/share/nginx/html/bin/upgrade
RUN chmod +x /usr/share/nginx/html/bin/test
RUN export PATH=$PATH:/usr/share/nginx/html/bin
RUN chmod +x /usr/local/bin/start
RUN chmod +x /usr/local/bin/upgrade
RUN chmod +x /usr/local/bin/test
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
@@ -150,4 +149,4 @@ EXPOSE 80
WORKDIR /usr/share/nginx/html
CMD ["/bin/bash", "bin/start"]
CMD ["/bin/bash", "/usr/local/bin/start"]
+21 -5
View File
@@ -16,6 +16,9 @@ $environments = Config::getParam('environments');
foreach($environments as $environment) {
$stdout = '';
$stderr = '';
Console::info('Warming up '.$environment['name'].' environment');
Console::execute('docker pull '.$environment['image'], null, $stdout, $stderr);
if(!empty($stdout)) {
@@ -31,20 +34,33 @@ class FunctionsV1
{
public $args = [];
public $images = [
];
public function setUp()
{
}
public function perform()
{
global $environments;
/**
* 1. Get event args
* 2. Unpackage code in an isolated folder
* 3. Execute in container with timeout
* 4. Update execution status
* 5. Update execution stdout & stderr
* 6. Trigger audit log
* 7. Trigger usage log
*/
// docker run --rm -v $(pwd):/app -w /app php:7.4-cli php tests/languages/php/test.php
}
public function tearDown()
{
// ... Remove environment for this job
$stdout = '';
$stderr = '';
$image = '';
Console::execute('docker pull '.$image, null, $stdout, $stderr);
}
}
+1 -1
View File
@@ -54,8 +54,8 @@ services:
- ./docs:/usr/share/nginx/html/docs
- ./public:/usr/share/nginx/html/public
- ./src:/usr/share/nginx/html/src
- ./bin:/usr/local/bin
- ./docker/nginx.conf:/etc/nginx/nginx.conf
- ./docker/bin:/home/bin
depends_on:
- mariadb
- redis