Deploy all deployments marked as managed = true.

@throws Exception
346039
public void deployManaged(@Observes DeployManagedDeployments event) throws Exception {
        forEachManagedDeployment(new Operation<Container, Deployment>() {
            @Inject
            private Event<DeploymentEvent> event;

            @Override
            public void perform(Container container, Deployment deployment) throws Exception {
                //when a container is manually controlled, the deployment is deployed automatically
                //once the container is manually started, not now
                if (!"manual".equals(container.getContainerConfiguration().getMode())) {
                    if (container.getState() != State.STARTED) {
                        throw new IllegalStateException("Trying to deploy a managed deployment "
                            + deployment.getDescription().getName()
                            + " to a non started managed container "
                            + container.getName());
                    }
                    event.fire(new DeployDeployment(container, deployment));
                }
            }
        });
    }
585811
public void setDeploymentApplicationConfigs(java.util.Collection<DeploymentApplicationConfig> deploymentApplicationConfigs) {
        if (deploymentApplicationConfigs == null) {
            this.deploymentApplicationConfigs = null;
            return;
        }

        this.deploymentApplicationConfigs = new java.util.ArrayList<DeploymentApplicationConfig>(deploymentApplicationConfigs);
    }
210254
public function isInstalled()
    {
        if ($this->installed === null) {
            if (!$this->isShared('config')) {
                throw new Exception('Attempting to check install status before application initialization.');
            }

            $this->installed = $this->make('config')->get('concrete.installed');
        }

        return $this->installed;
    }
734184
public void deployFile(String filePath) throws AppaloosaDeployException {
		deployFile(filePath, null, (List<String>) null, null);
	}
149115
public void deploy(RemoteRepository target, Artifact ... artifacts) throws DeploymentException {
        deploy(target, null, Arrays.asList(artifacts));
    }
398605
protected function deployDatasources()
    {

        // load the container
        $container = $this->getContainer();

        // load the container and check if we actually have datasource files to work with
        if ($datasourceFiles = $this->getDatasourceFiles()) {
            // load the naming directory instance
            $namingDirectory = $container->getNamingDirectory();

            // create a subdirectory for the container's datasoruces
            $namingDirectory->createSubdirectory(sprintf('php:env/%s/ds', $this->getContainer()->getName()));

            // iterate through all provisioning files (*-ds.xml), validate them and attach them to the configuration
            /** @var \AppserverIo\Appserver\Core\Api\ConfigurationService $configurationService */
            $configurationService = $this->getConfigurationService();
            foreach ($datasourceFiles as $datasourceFile) {
                try {
                    // explode the filename, context name and webapp path
                    list ($filename, $webappPath, $contextName) = $datasourceFile;

                    // validate the file, but skip it if validation fails
                    $configurationService->validateFile($filename);

                    // load the system properties
                    $systemProperties = $this->getDatasourceService()->getSystemProperties($container->getContainerNode());

                    // append the application specific properties
                    $systemProperties->add(SystemPropertyKeys::WEBAPP, $webappPath);
                    $systemProperties->add(SystemPropertyKeys::WEBAPP_NAME, $contextName);

                    // load the datasources from the file and replace the properties
                    $datasourcesNode = new DatasourcesNode();
                    $datasourcesNode->initFromFile($filename);
                    $datasourcesNode->replaceProperties($systemProperties);

                    // store the datasource in the system configuration
                    /** @var \AppserverIo\Description\Api\Node\DatasourceNode $datasourceNode */
                    foreach ($datasourcesNode->getDatasources() as $datasourceNode) {
                        // add the datasource to the system configuration
                        $this->getDatasourceService()->persist($datasourceNode);

                        // bind the datasource to the naming directory
                        $namingDirectory->bind(sprintf('php:env/%s/ds/%s', $container->getName(), $datasourceNode->getName()), $datasourceNode);

                        // log a message that the datasource has been deployed
                        $this->getInitialContext()->getSystemLogger()->debug(
                            sprintf('Successfully deployed datasource %s', $datasourceNode->getName())
                        );
                    }

                // log a message and continue with the next datasource node
                } catch (\Exception $e) {
                    // load the logger and log the XML validation errors
                    $systemLogger = $this->getInitialContext()->getSystemLogger();
                    $systemLogger->error($e->__toString());

                    // additionally log a message that DS will be missing
                    $systemLogger->critical(
                        sprintf('Will skip reading configuration in %s, datasources might be missing.', $filename)
                    );
                }
            }
        }
    }
591291
private void deployComponent(final ComponentContext<?> component, final Handler<AsyncResult<Void>> doneHandler) {
    log.info(String.format("%s - Deploying %d instances of %s", NetworkManager.this, component.instances().size(), component.isModule() ? component.asModule().module() : component.asVerticle().main()));
    log.debug(String.format("%s - Deploying component:%n%s", NetworkManager.this, component.toString(true)));
    // If the component is installable then we first need to install the
    // component to all the nodes in the cluster.
    if (component.isModule()) {
      final ModuleContext module = component.asModule();
      // If the component has a group then install the module to the group.
      if (component.group() != null) {
        // Make sure to install the module only to the appropriate deployment group.
        cluster.getGroup(component.group(), new Handler<AsyncResult<Group>>() {
          @Override
          public void handle(AsyncResult<Group> result) {
            if (result.failed()) {
              new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
            } else {
              result.result().getNodes(new Handler<AsyncResult<Collection<Node>>>() {
                @Override
                public void handle(AsyncResult<Collection<Node>> result) {
                  if (result.failed()) {
                    new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
                  } else {
                    final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(result.result().size());
                    counter.setHandler(new Handler<AsyncResult<Void>>() {
                      @Override
                      public void handle(AsyncResult<Void> result) {
                        if (result.failed()) {
                          new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
                        } else {
                          deployInstances(component.instances(), doneHandler);
                        }
                      }
                    });
                    for (Node node : result.result()) {
                      installModule(node, module, counter);
                    }
                  }
                }
              });
            }
          }
        });
      } else {
        // If the component doesn't have a group then it needs to be installed
        // to the cluster.
        cluster.getNodes(new Handler<AsyncResult<Collection<Node>>>() {
          @Override
          public void handle(AsyncResult<Collection<Node>> result) {
            if (result.failed()) {
              new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
            } else {
              final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(result.result().size());
              counter.setHandler(new Handler<AsyncResult<Void>>() {
                @Override
                public void handle(AsyncResult<Void> result) {
                  if (result.failed()) {
                    new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
                  } else {
                    deployInstances(component.instances(), doneHandler);
                  }
                }
              });
              for (Node node : result.result()) {
                installModule(node, module, counter);
              }
            }
          }
        });
      }
    } else {
      deployInstances(component.instances(), doneHandler);
    }
  }
430793
def deploy_sitesettings():
    
    
    sitesettings = '/'.join([deployment_root(),'env',env.project_fullname,'project',env.project_package_name,'sitesettings'])
    local_dir = os.path.join(os.getcwd(),env.project_package_name,'sitesettings')
 
    created = deploy_files(local_dir, sitesettings)
    if env.verbosity and created:
        print env.host,"DEPLOYING sitesettings"
        for path in created:
            tail = path.split('/')[-1]
            print ' * uploaded',tail
421872
public void init() throws Exception {
        userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
        System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath());

        if (!cfg.exists()) {

            ConfigurationManager manager = new ConfigurationManager(cfg, false, locateConfigurationProvider());

            try {

                manager.runProjectConfigurationInitializers();

                if (options.isVerbose()) {
                    log.info("CONFIGURATION FILE [" + cfg.getAbsolutePath() + "] CREATION COMPLETE");
                }

            } catch (IOException aux) {
                if (options.isVerbose()) {
                    log.error("The system can't create the file [ " + cfg.getAbsolutePath() + "]");
                }
                if (options.isThrowException()) {
                    System.setProperty("user.dir", userDir);
                    throw aux;
                }
            }

        } else {
            if (options.isVerbose()) {
                log.error("The configuration file [" + cfg.getAbsolutePath() + "] already exists");
            }
        }
        System.setProperty("user.dir", userDir);
    }
852477
public void deploy() throws MojoExecutionException {
    stager.stage();

    DeployConfiguration config =
        configBuilder.buildDeployConfiguration(ImmutableList.of(deployMojo.getStagingDirectory()));

    try {
      deployMojo.getAppEngineFactory().deployment().deploy(config);
    } catch (AppEngineException ex) {
      throw new MojoExecutionException("App Engine application deployment failed", ex);
    }
  }
649002
public function run(Deployment $deployment)
    {
        parent::run($deployment);

        $applications = $deployment->getApplications();
        if (count($applications) === 0) {
            throw InvalidConfigurationException::createNoApplicationConfigured();
        }

        $nodes = $deployment->getNodes();
        if (count($nodes) === 0) {
            throw InvalidConfigurationException::createNoNodesConfigured();
        }

        $this->configureRollbackTasks($deployment);

        foreach ($this->stages as $stage) {
            $deployment->getLogger()->notice('Stage ' . $stage);
            foreach ($nodes as $node) {
                $deployment->getLogger()->debug('Node ' . $node->getName());
                foreach ($applications as $application) {
                    if (! $application->hasNode($node)) {
                        continue;
                    }

                    $deployment->getLogger()->debug('Application ' . $application->getName());

                    try {
                        $this->executeStage($stage, $node, $application, $deployment);
                    } catch (Exception $exception) {
                        return;
                    }
                }
            }
        }
        if ($deployment->getStatus() === Deployment::STATUS_UNKNOWN) {
            $deployment->setStatus(Deployment::STATUS_SUCCESS);
        }
    }
1048268
@Override
    public void onDeploy(DeploymentEvent event) {
        AbstractRuntimeManager runtimeManager = (AbstractRuntimeManager) event.getDeployedUnit().getRuntimeManager();        
        KieBase kieBase = runtimeManager.getEnvironment().getKieBase();
        Collection<Process> processes = kieBase.getProcesses(); 
        
        Map<String, DeployedAsset> mapProcessById = event.getDeployedUnit().getDeployedAssets()
                                                                            .stream()
                                                                            .collect(toMap(DeployedAsset::getId, asset -> asset));        
        for( Process process : processes ) {
            if( ((WorkflowProcess)process).isDynamic()) {
                String caseIdPrefix = collectCaseIdPrefix(process);
                Collection<CaseMilestone> caseMilestones = collectMilestoness(process);
                Collection<CaseStage> caseStages = collectCaseStages(event.getDeploymentId(), process.getId(), ((WorkflowProcess)process));                
                Collection<CaseRole> caseRoles = collectCaseRoles(process);
                Collection<AdHocFragment> adHocFragments = collectAdHocFragments((WorkflowProcess)process);
                Map<String, List<String>> dataAccessRestrictions = collectDataAccessRestrictions(process);
                
                CaseDefinitionImpl caseDef = new CaseDefinitionImpl((ProcessAssetDesc) mapProcessById.get(process.getId()), caseIdPrefix, caseStages, caseMilestones, caseRoles, adHocFragments, dataAccessRestrictions);
                
                availableCases.add(caseDef);
                caseIdGenerator.register(caseIdPrefix);
            }
        }
        
        // collect role information
        Collection<DeployedAsset> assets = event.getDeployedUnit().getDeployedAssets();
        List<String> roles = null;
        for( DeployedAsset asset : assets ) {
            if( asset instanceof ProcessAssetDesc ) {  
                // if it's not dynamic it's considered as not case definition
                if (!((ProcessAssetDesc) asset).isDynamic()) {
                    availableProcesses.add((ProcessAssetDesc) asset);
                }
                if (roles == null) {
                    roles = ((ProcessAssetDesc) asset).getRoles();
                }
            }
        }
        if (roles == null) {
            roles = Collections.emptyList();
        }
        deploymentRolesManager.addRolesForDeployment(event.getDeploymentId(), roles);

    }
1333203
@TaskAction
  public void deployAction() throws AppEngineException {
    gcloud
        .newDeployment(CloudSdkOperations.getDefaultHandler(getLogger()))
        .deployQueue(deployExtension.toDeployProjectConfigurationConfiguration());
  }
451004
protected function continueDeploy() {
		$this->log("Checking status of {$this->Title}...");

		// Skip deployment for dry run
		if($this->Pipeline()->DryRun) {
			$this->log("[Skipped] Checking progress of deployment");
			$this->finish();
			return !$this->isFailed();
		}

		// Get related deployment
		$deployment = $this->Pipeline()->CurrentDeployment();
		if(empty($deployment) || !$deployment->exists()) {
			$this->log("Missing deployment for in-progress {$this->Title}");
			$this->markFailed();
			return false;
		}

		// Check finished state
		$status = $deployment->ResqueStatus();
		if($this->checkResqueStatus($status)) {
			$this->finish();
		}
		return !$this->isFailed();
	}
235761
public void deployApplication(String applicationName, String... classpathLocations) throws IOException {

        final List<URL> classpathElements = Arrays.stream(classpathLocations)
            .map(classpath -> Thread.currentThread().getContextClassLoader().getResource(classpath))
            .collect(Collectors.toList());

        deployApplication(applicationName, classpathElements.toArray(new URL[classpathElements.size()]));
    }
1200488
protected function deploy()
    {
        // create deploy outputfile
        $this->createOutputFile($this->outputFile, false);

        // create undo deploy outputfile
        $this->createOutputFile($this->undoOutputFile, true);
    }
387522
public void deploy(InputStream inputStream) throws IOException {
        final List<? extends HasMetadata> entities = deploy("application", inputStream);

        if (this.applicationName == null) {

            Optional<String> deployment = entities.stream()
                .filter(hm -> hm instanceof Deployment)
                .map(hm -> (Deployment) hm)
                .map(rc -> rc.getMetadata().getName()).findFirst();

            deployment.ifPresent(name -> this.applicationName = name);
        }
    }