Method: Cnvrg::CLI#commit_notebook

Defined in:
lib/cnvrg/cli.rb

#commit_notebook(notebook_image_name) ⇒ Object



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/cnvrg/cli.rb', line 1033

def commit_notebook(notebook_image_name)
  verify_logged_in(false)
  log_start(__method__,args,options)
  begin
    docker_path = verify_software_installed("docker")

    container_id = get_container_id
    owner = Cnvrg::CLI.get_owner()
    say "Commiting notebook changes to: #{notebook_image_name}", Thor::Shell::Color::BLUE

    commit_res = system("#{docker_path} commit #{container_id} #{notebook_image_name}")
    if commit_res
      checker = Helpers.checkmark()
      log_end(0)
      say "#{checker} Done.", Thor::Shell::Color::GREEN
    else
      log_End(1,"can't commit new notebook image")
      say "Couldn't commit new notebook image ", Thor::Shell::Color::RED

    end
  rescue SignalException
    log_end(-1)
    say "/nAborting"
    exit(1)
  end
end