AppserverIo\Appserver\Core\Api\AppService::deploy PHP Method

deploy() public method

Adds the .dodeploy flag file in the deploy folder, therefore the app will be deployed with the next restart.
public deploy ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, AppserverIo\Configuration\Interfaces\NodeInterface $appNode ) : void
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container the app is bound to
$appNode AppserverIo\Configuration\Interfaces\NodeInterface The application node object
return void
    public function deploy(ContainerNodeInterface $containerNode, NodeInterface $appNode)
    {
        // prepare file name
        $extractor = $this->getExtractor();
        $fileName = $appNode->getName() . $extractor->getExtensionSuffix();
        // load the file info
        $archive = new \SplFileInfo($this->getDeployDir($containerNode) . DIRECTORY_SEPARATOR . $fileName);
        // flag the archive => deploy it with the next restart
        $extractor->flagArchive($archive, ExtractorInterface::FLAG_DODEPLOY);
    }

Usage Example

Example #1
0
 /**
  * Tests if we will run through the deploy process without an error
  *
  * @return null
  */
 public function testDeploy()
 {
     $mockExtractor = $this->getMock('\\AppserverIo\\Appserver\\Core\\Interfaces\\ExtractorInterface');
     $mockExtractor->expects($this->once())->method('flagArchive');
     $this->appService->injectExtractor($mockExtractor);
     $this->appService->deploy($appNode = new AppNode(__METHOD__, '/opt/appserver/targetwebapp'));
 }
All Usage Examples Of AppserverIo\Appserver\Core\Api\AppService::deploy