stager/lib/vcap/stager/task.rb
def perform
    @logger.info("Starting task for request: #{@request}")

    @task_logger.info("Setting up temporary directories")
    workspace = VCAP::Stager::Workspace.create

    @task_logger.info("Downloading application")
    app_path = File.join(workspace.root_dir, "app.zip")
    download_app(app_path)

    @task_logger.info("Unpacking application")
    unpack_app(app_path, workspace.unstaged_dir)

    @task_logger.info("Staging application")
    stage_app(workspace.unstaged_dir, workspace.staged_dir, @task_logger)

    @task_logger.info("Creating droplet")
    droplet_path = File.join(workspace.root_dir, "droplet.tgz")
    create_droplet(workspace.staged_dir, droplet_path)

    @task_logger.info("Uploading droplet")
    upload_droplet(droplet_path)

    @task_logger.info("Done!")

    nil

  ensure
    workspace.destroy if workspace
  end
# Attempts to stage the application and upload the result to the specified
# endpoint.
Attempts to stage the application and upload the result to the specified
endpoint.
Attempts to stage the application and upload the result to the specified endpoint .
def perform
    @logger.info("Starting task for request: #{@request}")
    @task_logger.info("Setting up temporary directories")
    workspace = VCAP::Stager::Workspace.create
    @task_logger.info("Downloading application")
    app_path = File.join(workspace.root_dir, "app.zip")
    download_app(app_path)
    @task_logger.info("Unpacking application")
    unpack_app(app_path, workspace.unstaged_dir)
    @task_logger.info("Staging application")
    stage_app(workspace.unstaged_dir, workspace.staged_dir, @task_logger)
    @task_logger.info("Creating droplet")
    droplet_path = File.join(workspace.root_dir, "droplet.tgz")
    create_droplet(workspace.staged_dir, droplet_path)
    @task_logger.info("Uploading droplet")
    upload_droplet(droplet_path)
    @task_logger.info("Done!")
    nil
  ensure
    workspace.destroy if workspace
  end
def perform @logger . info ( "Starting task for request: #{@request}" ) @task_logger . info ( "Setting up temporary directories" ) workspace = VCAP :: Stager :: Workspace . create @task_logger . info ( "Downloading application" ) app_path = File . join ( workspace . root_dir , "app.zip" ) download_app ( app_path ) @task_logger . info ( "Unpacking application" ) unpack_app ( app_path , workspace . unstaged_dir ) @task_logger . info ( "Staging application" ) stage_app ( workspace . unstaged_dir , workspace . staged_dir , @task_logger ) @task_logger . info ( "Creating droplet" ) droplet_path = File . join ( workspace . root_dir , "droplet.tgz" ) create_droplet ( workspace . staged_dir , droplet_path ) @task_logger . info ( "Uploading droplet" ) upload_droplet ( droplet_path ) @task_logger . info ( "Done!" ) nil ensure workspace . destroy if workspace end
Attempts to stage the application and upload the result to the specified
endpoint.
Attempts to stage the application and upload the result to the specified endpoint .