Advertisement
Guest User

Untitled

a guest
Jun 10th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. -- Insert the base values for the initial Gerrit user. This user will
  2. -- become the administrator of the server. As this user is a local
  3. -- user it will not be able to login through the web UI.
  4. START TRANSACTION;
  5.  
  6. SET @gerrit_admin_account_id = {{ gerrit_admin_account_id }};
  7. SET @gerrit_admin_group_id = 1;
  8.  
  9. -- Create a local user, we need to insert for this.
  10.  
  11. INSERT INTO account_external_ids
  12. SET account_id = @gerrit_admin_account_id,
  13. email_address = NULL,
  14. password = NULL,
  15. external_id = 'username:{{ gerrit_admin_account_name }}';
  16.  
  17. INSERT INTO account_external_ids
  18. SET account_id = @gerrit_admin_account_id,
  19. email_address = '{{ gerrit_admin_account_email }}',
  20. password = NULL,
  21. external_id = 'mailto:{{ gerrit_admin_account_email }}';
  22.  
  23. -- Add local user to administrator group.
  24.  
  25. INSERT INTO account_group_members
  26. SET account_id = @gerrit_admin_account_id,
  27. group_id = @gerrit_admin_group_id;
  28.  
  29. -- Insert the audit information.
  30.  
  31. INSERT INTO account_group_members_audit
  32. SET added_by = @gerrit_admin_account_id,
  33. removed_by = NULL,
  34. removed_on = NULL,
  35. account_id = @gerrit_admin_account_id,
  36. group_id = @gerrit_admin_group_id,
  37. added_on = NOW();
  38.  
  39. -- Set the sequence next value to increment to 1000001.
  40.  
  41. SET @sql = CONCAT('ALTER TABLE account_id AUTO_INCREMENT = ', @gerrit_admin_account_id + 1);
  42. PREPARE stmt FROM @sql;
  43. EXECUTE stmt;
  44.  
  45. -- Insert the public SSH key for the administrator account.
  46.  
  47. INSERT INTO account_ssh_keys
  48. SET ssh_public_key = '{{ gerrit_admin_account_ssh_public_key }}',
  49. valid = 'Y',
  50. account_id = @gerrit_admin_account_id,
  51. seq = 1;
  52.  
  53. -- Insert the internal Gerrit user which is connected to the
  54. -- account_external_id we created before.
  55.  
  56. INSERT INTO accounts
  57. SET registered_on = NULL,
  58. full_name = '{{ gerrit_admin_account_fullname }}',
  59. preferred_email = NULL,
  60. contact_filed_on = NULL,
  61. maximum_page_size = 25,
  62. show_site_header = 'Y',
  63. use_flash_clipboard = 'Y',
  64. download_url = NULL,
  65. download_command = NULL,
  66. copy_self_on_email = 'N',
  67. date_format = NULL,
  68. time_format = NULL,
  69. relative_date_in_change_table = 'N',
  70. diff_view = NULL,
  71. size_bar_in_change_table = 'Y',
  72. legacycid_in_change_table = 'N',
  73. review_category_strategy = NULL,
  74. mute_common_path_prefixes = 'Y',
  75. inactive = 'N',
  76. account_id = @gerrit_admin_account_id;
  77.  
  78. COMMIT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement