Loading .dockerignore +2 −0 Original line number Diff line number Diff line .git Dockerfile builds/delta/*/*/*.zip builds/full/*/*/*.zip README.md +23 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,29 @@ Got a question? Not sure where it should be made? See [CONTRIBUTING](CONTRIBUTIN ## How to use ### Test ``` $ sudo docker stop lineageota \ && sudo docker build -t e/lineageota . \ && sudo docker run \ -d \ -p 80:80 \ --rm \ -v "${PWD}/builds/full:/var/www/html/builds/full" \ --name lineageota \ e/lineageota \ ``` Access to API via http://localhost/api/v1/\<device\>/\<channel\> Get logs with ``` $ sudo docker exec -ti lineageota tail -f LineageOTA.log ``` ### Composer ```shell Loading index.php +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ $protocol = 'https://'; $logger = new Logger('main'); $logger->pushHandler(new StreamHandler('LineageOTA.log', Logger::WARNING)); $logger->pushHandler(new StreamHandler('LineageOTA.log', Logger::INFO)); $app = new CmOta($logger); $app Loading src/Helpers/Builds.php +14 −5 Original line number Diff line number Diff line Loading @@ -31,9 +31,9 @@ // This will contain the build list based on the current request private $builds = array(); private $postData = array(); private $logger = null; private $currentBuild = null; /** * Constructor of the Builds class. Loading Loading @@ -61,8 +61,12 @@ foreach ( $this->builds as $build ) { // TODO look into incremental // TODO look into android_version if (!is_null($this->currentBuild) && strcmp($this->currentBuild->getAndroidVersion(), $build->getAndroidVersion()) != 0) { $this->logger->info($build->getIncremental().' ignored as Android version is not the same'); continue; } $this->logger->info($build->getIncremental().' is a new update'); array_push( $ret, array( // CyanogenMod Loading Loading @@ -175,6 +179,11 @@ if ( $build->isValid( $this->postData['params'] ) ) { array_push( $this->builds , $build ); if (strcmp($this->postData['params']['source_incremental'], $build->getIncremental()) == 0) { $this->currentBuild = $build; $this->logger->info($build->getIncremental().' is the current build'); } } } } Loading Loading
.dockerignore +2 −0 Original line number Diff line number Diff line .git Dockerfile builds/delta/*/*/*.zip builds/full/*/*/*.zip
README.md +23 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,29 @@ Got a question? Not sure where it should be made? See [CONTRIBUTING](CONTRIBUTIN ## How to use ### Test ``` $ sudo docker stop lineageota \ && sudo docker build -t e/lineageota . \ && sudo docker run \ -d \ -p 80:80 \ --rm \ -v "${PWD}/builds/full:/var/www/html/builds/full" \ --name lineageota \ e/lineageota \ ``` Access to API via http://localhost/api/v1/\<device\>/\<channel\> Get logs with ``` $ sudo docker exec -ti lineageota tail -f LineageOTA.log ``` ### Composer ```shell Loading
index.php +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ $protocol = 'https://'; $logger = new Logger('main'); $logger->pushHandler(new StreamHandler('LineageOTA.log', Logger::WARNING)); $logger->pushHandler(new StreamHandler('LineageOTA.log', Logger::INFO)); $app = new CmOta($logger); $app Loading
src/Helpers/Builds.php +14 −5 Original line number Diff line number Diff line Loading @@ -31,9 +31,9 @@ // This will contain the build list based on the current request private $builds = array(); private $postData = array(); private $logger = null; private $currentBuild = null; /** * Constructor of the Builds class. Loading Loading @@ -61,8 +61,12 @@ foreach ( $this->builds as $build ) { // TODO look into incremental // TODO look into android_version if (!is_null($this->currentBuild) && strcmp($this->currentBuild->getAndroidVersion(), $build->getAndroidVersion()) != 0) { $this->logger->info($build->getIncremental().' ignored as Android version is not the same'); continue; } $this->logger->info($build->getIncremental().' is a new update'); array_push( $ret, array( // CyanogenMod Loading Loading @@ -175,6 +179,11 @@ if ( $build->isValid( $this->postData['params'] ) ) { array_push( $this->builds , $build ); if (strcmp($this->postData['params']['source_incremental'], $build->getIncremental()) == 0) { $this->currentBuild = $build; $this->logger->info($build->getIncremental().' is the current build'); } } } } Loading