Example #1
0
  @Security.Authenticated
  public Result deletePackage(String name) {
    boolean success = ConfigManager.getInstance().deletePacakge(name);

    if (success) {
      flash("message", "Successfully deleted package " + name);
    } else {
      flash("error", "Unable to delete package " + name);
    }
    return redirect(routes.Workflows.deploy());
  }
Example #2
0
  @Security.Authenticated(Secured.class)
  public Result deploy() {
    Http.MultipartFormData body = request().body().asMultipartFormData();
    Http.MultipartFormData.FilePart filePart = body.getFile("filename");

    if (filePart != null) {
      ConfigManager configManager = ConfigManager.getInstance();
      try {
        configManager.unpack((File) filePart.getFile());
      } catch (Exception e) {
        flash("error", "Could not verify package.");
        return redirect(routes.Workflows.uploadWorkflow());
      }

      flash("message", "Packages zip file was successfully deployed");
      return redirect(routes.Workflows.uploadWorkflow());
    } else {
      flash("error", "Missing file");
      return badRequest();
    }
  }