You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.6KB

  1. #' Make a fresh install from the base VM
  2. #'
  3. #' Make a fresh install from the base VM
  4. #'
  5. #' Set the permissions,
  6. #' create the admin account for the system, database, and i2b2
  7. #' Set the domain and project
  8. #' Delete the default users
  9. #' Clear the metadata database, and the *_dimension tables in demodata
  10. #'
  11. #' @param admin The admin account for the PostgreSQL database
  12. #' @param pass the password for the admin account
  13. #' @param domain_id The desired domain_id
  14. #' @param domain_name The desired domain_name
  15. #' @export
  16. fresh_install <- function(admin, pass, domain_id, domain_name)
  17. {
  18. # System
  19. set_permissions()
  20. create_admin(admin, pass)
  21. # Clear the default install
  22. clear_webclient()
  23. clear_default_workdata()
  24. clear_default_metadata()
  25. clear_default_imdata()
  26. clear_default_demodata()
  27. # Set the new domain
  28. set_domain(domain_id, domain_name)
  29. # Add new admin
  30. add_users("i2b2", "demouser", data.frame(id = admin, password = pass, name = admin, email = "", role = "ADMIN", project = "@"))
  31. # Prepare to clone i2b2demodata
  32. service("pg", "restart")
  33. add_project("main", "Main Project")
  34. add_user_roles("i2b2", "demouser", "admin", "main", c("MANAGER", "USER", "DATA_PROT"))
  35. # Clean old users
  36. delete_users(c("i2b2","demo"))
  37. # Add ontologies
  38. # add_ont("Name", "Scheme")
  39. # Populate the ontologies
  40. # populate_ont(readr::read_csv(".ont"), readr::read_csv(".modi"), "Scheme")
  41. # Populate the concept/provider tables needed
  42. # populate_concept(readr::read_csv(".ont", readr::read_csv(".modi", "Scheme", "main")))
  43. # Restart wildfly
  44. service("jboss", "restart")
  45. }