Example #1
0
  public Object execute(ExecutionEvent event) throws ExecutionException {

    DeployType type = DeployPreferenceUtil.getDeployType(selectedProject);

    if (type == null) {
      if (isCapistranoProject(selectedProject)) {
        deployWithCapistrano();
      } else if (selectedProject != null && isFTPProject(selectedProject)) {
        deployWithFTP();
      } else if (selectedProject != null && isHerokuProject(selectedProject)) {
        deployWithHeroku();
      } else if (selectedProject != null && isEYProject(selectedProject)) {
        deployWithEngineYard();
      }
    } else if (type == DeployType.HEROKU) {
      deployWithHeroku();
    } else if (type == DeployType.FTP) {
      deployWithFTP();
    } else if (type == DeployType.CAPISTRANO) {
      deployWithCapistrano();
    } else if (isEYProject(selectedProject)) {
      deployWithEngineYard();
    }
    return null;
  }
Example #2
0
  private boolean isEYProject(IProject selectedProject) {

    DeployType type = DeployPreferenceUtil.getDeployType(selectedProject);

    // Engine Yard gem does not work in Windows
    if (!Platform.getOS().equals(Platform.OS_WIN32)) {
      if (type.equals(DeployType.ENGINEYARD)) {
        return true;
      }
    }

    return false;
  }
Example #3
0
 private void deployWithFTP() {
   SynchronizeProjectAction action = new SynchronizeProjectAction();
   action.setActivePart(
       null, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart());
   action.setSelection(
       PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection());
   ISiteConnection[] sites = SiteConnectionUtils.findSitesForSource(selectedProject, true);
   if (sites.length > 1) {
     String lastConnection = ResourceSynchronizationUtils.getLastSyncConnection(selectedProject);
     if (lastConnection == null) {
       lastConnection = DeployPreferenceUtil.getDeployEndpoint(selectedProject);
     }
     if (lastConnection != null) {
       action.setSelectedSite(SiteConnectionUtils.getSiteWithDestination(lastConnection, sites));
     }
   }
   action.run(null);
 }