repo-manifest.js 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. module.exports = ((name, options)=>{
  2. // Default set of users in main repos.
  3. var users = [
  4. { username : `${options.username}`, password : `${options.password}` }
  5. , { username : `chess` }
  6. // , { username : `baptistdev`, password : 'encrypted' }
  7. // , { username : `guest`, password : 'encrypted' }
  8. ]
  9. // ${options.reposerver} should be used to lookup current config.
  10. // User can always add more branches and remotes as needed. Mainifest only occupies
  11. // well defined namespaces
  12. var remotes = {
  13. // these are both fetch and push remotes. Use push - remotes to override push.
  14. 'chess' : {
  15. server : `${options.reposerver}`, user : 'chess', path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch
  16. , push : 'no-pushing' }
  17. , 'baptistdev-public' : {
  18. server : `https://github.com`, user : 'baptistdev', path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch
  19. , push : 'no-pushing' }
  20. // Multiple urls dont tell us the current origin which may be
  21. // different based on currently available/accessible based on device and client.
  22. // We just treat them as different remotes and merge as needed.
  23. //
  24. , 'origin' : {
  25. server : `${options.reposerver}`, user : '${options.username}', path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch
  26. }
  27. , 'origin-public' : {
  28. server : `https://git.bbh.org.in`, user : 'chess', path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch
  29. , push : {
  30. server : `${options.reposerver}`, user : `${options.username}`, path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`}
  31. }
  32. }
  33. , 'origin-unc' : {
  34. server : `//172.16.0.27/repos`, user : '${options.username}', path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch
  35. }
  36. // , { `${options.username}` : `https://git.bbh.org.in/${options.username}/elxr.git` }
  37. }
  38. // , 'fetch-remotes' : [] // Multiple fetch remotes are not supported by git.
  39. // We therefore need to use
  40. // - a pullall
  41. // - or branch alias for multiple remote branch tracking branch strategy.
  42. // -- This is however limited to corresponding branch names
  43. // tracking branches.
  44. // We at least need one branch for each remote that we wish to track.
  45. // , 'tracking-branches' : [
  46. // { master : ['origin/master', 'chess/master'] }
  47. // ]
  48. var reposerverinstances = {
  49. 'http://git.bbh' : { users, remotes }
  50. , 'https://git.bbh.org.in' : { users, remotes, external : true }
  51. , '//172.16.0.27/repos' : { users, remotes }
  52. , 'https://github.com' : {
  53. // We host a miniaml set of repositories in github.
  54. get users() { return [{ username : `${this.username}` }]}, username : `baptistdev`
  55. , remotes : {
  56. 'baptistdev-public' : {
  57. server : `https://github.com`, user : 'baptistdev', path : ``, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch
  58. , push : 'no-pushing' }
  59. // , Add other remotes here.
  60. }
  61. , external : true, public : true
  62. }
  63. }
  64. return {
  65. reposervers : Object.keys(reposerverinstances)
  66. , reposerverinstances
  67. , repos : [
  68. { repo : 'elxr' }
  69. ]
  70. }
  71. })