Search in sources :

Example 1 with DefaultDeploymentTask

use of com.aws.greengrass.deployment.DefaultDeploymentTask in project aws-greengrass-nucleus by aws-greengrass.

the class DeploymentTaskIntegrationTest method submitSampleJobDocument.

@SuppressWarnings("PMD.AvoidCatchingGenericException")
private Future<DeploymentResult> submitSampleJobDocument(URI uri, Long timestamp) throws Exception {
    kernel.getContext().get(DeploymentDirectoryManager.class).createNewDeploymentDirectory("testFleetConfigArn" + deploymentCount.getAndIncrement());
    sampleJobDocument = OBJECT_MAPPER.readValue(new File(uri), DeploymentDocument.class);
    sampleJobDocument.setTimestamp(timestamp);
    sampleJobDocument.setGroupName(MOCK_GROUP_NAME);
    DefaultDeploymentTask deploymentTask = new DefaultDeploymentTask(dependencyResolver, componentManager, kernelConfigResolver, deploymentConfigMerger, logger, new Deployment(sampleJobDocument, Deployment.DeploymentType.IOT_JOBS, "jobId", DEFAULT), deploymentServiceTopics, kernel.getContext().get(ExecutorService.class), deploymentDocumentDownloader, thingGroupHelper);
    return executorService.submit(deploymentTask);
}
Also used : DeploymentDocument(com.aws.greengrass.deployment.model.DeploymentDocument) ExecutorService(java.util.concurrent.ExecutorService) DeploymentDirectoryManager(com.aws.greengrass.deployment.DeploymentDirectoryManager) Deployment(com.aws.greengrass.deployment.model.Deployment) DefaultDeploymentTask(com.aws.greengrass.deployment.DefaultDeploymentTask) File(java.io.File) FileMatchers.anExistingFile(org.hamcrest.io.FileMatchers.anExistingFile)

Example 2 with DefaultDeploymentTask

use of com.aws.greengrass.deployment.DefaultDeploymentTask in project aws-greengrass-nucleus by aws-greengrass.

the class PluginComponentTest method submitSampleJobDocument.

private static Future<DeploymentResult> submitSampleJobDocument(DeploymentDocument sampleJobDocument, Kernel kernel) {
    ComponentManager componentManager = kernel.getContext().get(ComponentManager.class);
    DependencyResolver dependencyResolver = kernel.getContext().get(DependencyResolver.class);
    KernelConfigResolver kernelConfigResolver = kernel.getContext().get(KernelConfigResolver.class);
    DeploymentConfigMerger deploymentConfigMerger = kernel.getContext().get(DeploymentConfigMerger.class);
    DeploymentDocumentDownloader deploymentDocumentDownloader = kernel.getContext().get(DeploymentDocumentDownloader.class);
    DefaultDeploymentTask deploymentTask = new DefaultDeploymentTask(dependencyResolver, componentManager, kernelConfigResolver, deploymentConfigMerger, LogManager.getLogger("Deployer"), new Deployment(sampleJobDocument, Deployment.DeploymentType.IOT_JOBS, "jobId", DEFAULT), Topics.of(kernel.getContext(), DeploymentService.DEPLOYMENT_SERVICE_TOPICS, null), kernel.getContext().get(ExecutorService.class), deploymentDocumentDownloader, thingGroupHelper);
    return kernel.getContext().get(ExecutorService.class).submit(deploymentTask);
}
Also used : DeploymentDocumentDownloader(com.aws.greengrass.deployment.DeploymentDocumentDownloader) DeploymentConfigMerger(com.aws.greengrass.deployment.DeploymentConfigMerger) ComponentManager(com.aws.greengrass.componentmanager.ComponentManager) KernelConfigResolver(com.aws.greengrass.componentmanager.KernelConfigResolver) ExecutorService(java.util.concurrent.ExecutorService) Deployment(com.aws.greengrass.deployment.model.Deployment) DefaultDeploymentTask(com.aws.greengrass.deployment.DefaultDeploymentTask) DependencyResolver(com.aws.greengrass.componentmanager.DependencyResolver)

Aggregations

DefaultDeploymentTask (com.aws.greengrass.deployment.DefaultDeploymentTask)2 Deployment (com.aws.greengrass.deployment.model.Deployment)2 ExecutorService (java.util.concurrent.ExecutorService)2 ComponentManager (com.aws.greengrass.componentmanager.ComponentManager)1 DependencyResolver (com.aws.greengrass.componentmanager.DependencyResolver)1 KernelConfigResolver (com.aws.greengrass.componentmanager.KernelConfigResolver)1 DeploymentConfigMerger (com.aws.greengrass.deployment.DeploymentConfigMerger)1 DeploymentDirectoryManager (com.aws.greengrass.deployment.DeploymentDirectoryManager)1 DeploymentDocumentDownloader (com.aws.greengrass.deployment.DeploymentDocumentDownloader)1 DeploymentDocument (com.aws.greengrass.deployment.model.DeploymentDocument)1 File (java.io.File)1 FileMatchers.anExistingFile (org.hamcrest.io.FileMatchers.anExistingFile)1