Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. DECLARE @main_DIR NVARCHAR(max)
  2. DECLARE @service NVARCHAR(max)
  3. DECLARE @API NVARCHAR(max)
  4. DECLARE @apiSocket INT
  5.  
  6. --Please fill in the correct values below:--
  7. -- --
  8. -- --
  9. -- --
  10. -- --
  11. --
  12. ----------------------------------------------------------------------
  13. --please Type the correct path and !! do use double backslashes !!
  14. set @main_DIR ='C:\\Program Files (x86)\\Slimstock\\Slim4_RTH_TEST\\'
  15. --please Type the correct Service Name
  16. set @service ='Slim4_RTH_TEST'
  17. --API socket info / Please fill in the correct socket--
  18. set @apiSocket =8062
  19. ----------------------------------------------------------------------
  20.  
  21. --API info !DO NOT ALTER!--
  22. set @API = (select bladeId from BladeControl where bladeId = 'API')
  23. ;
  24. TRUNCATE TABLE autoupgradecontrol;
  25.  
  26. --Master/slave/api insert--
  27. INSERT INTO autoupgradecontrol (
  28. aupentity
  29. ,aupentitytype
  30. ,aupentityhost
  31. ,aupentitysocket
  32. ,aupEntityServiceName
  33. ,aupentityinstalldir
  34. ,aupupgradearchivedir
  35. ,aupupgradeworkingdir
  36. ,aupbotservicename
  37. )
  38. select bladeId
  39. , bladeType
  40. , bladeHost
  41. , bladeSocket
  42. , @service
  43. , concat(@main_DIR,'slim4server')
  44. , concat(@main_DIR,'slim4server\\Archive')
  45. , concat(@main_DIR,'slim4server\\aupTemp')
  46. , concat(@service,'_Update')
  47. from BladeControl where bladeId not like 'API%'
  48. ;
  49. --insert API Server
  50. IF @API = 'API'
  51. BEGIN
  52. INSERT INTO autoupgradecontrol (
  53. aupentity
  54. ,aupentitytype
  55. ,aupentityhost
  56. ,aupentitysocket
  57. ,aupEntityServiceName
  58. ,aupentityinstalldir
  59. ,aupupgradearchivedir
  60. ,aupupgradeworkingdir
  61. ,aupbotservicename
  62. )
  63. select bladeId
  64. , bladeType
  65. , bladeHost
  66. , bladeSocket
  67. , @service
  68. , concat(@main_DIR,'slim4server')
  69. , concat(@main_DIR,'slim4server\\Archive')
  70. , concat(@main_DIR,'slim4server\\aupTemp')
  71. , concat(@service,'_Update')
  72. from BladeControl where bladeId = 'API'
  73. END
  74. ELSE
  75. begin
  76. INSERT INTO autoupgradecontrol (
  77. aupentity
  78. ,aupentitytype
  79. ,aupentityhost
  80. ,aupentitysocket
  81. ,aupEntityServiceName
  82. ,aupentityinstalldir
  83. ,aupupgradearchivedir
  84. ,aupupgradeworkingdir
  85. ,aupbotservicename
  86. )
  87. select 'API'
  88. , null
  89. , null
  90. , null
  91. , @service
  92. , concat(@main_DIR,'slim4server')
  93. , concat(@main_DIR,'slim4server\\Archive')
  94. , concat(@main_DIR,'slim4server\\aupTemp')
  95. , concat(@service,'_Update')
  96. END
  97. ;
  98.  
  99. --API adjustment--
  100. update AutoUpgradeControl set aupEntityServiceName=CONCAT(@service,'_API'),
  101. aupentityhost='localhost', aupentitytype=2, aupEntitySocket=@apiSocket where aupentity='API'
  102. ;
  103.  
  104. --Core server adjustment--
  105. --update AutoUpgradeControl set aupEntityServiceName=CONCAT(@service,'_PRD') where aupentity='MASTER' --
  106.  
  107. --Client, Web, Database, Webclient, App insert--
  108. INSERT INTO autoupgradecontrol (
  109. aupentity
  110. ,aupentitytype
  111. ,aupentityhost
  112. ,aupentitysocket
  113. ,aupEntityServiceName
  114. ,aupentityinstalldir
  115. ,aupupgradearchivedir
  116. ,aupupgradeworkingdir
  117. ,aupbotservicename
  118. )
  119. VALUES
  120. (
  121. 'Client'
  122. ,3
  123. ,NULL
  124. ,NULL
  125. ,NULL
  126. ,CONCAT(@main_DIR,'slim4')
  127. ,CONCAT(@Main_DIR,'Slim4\\Archive')
  128. ,CONCAT(@Main_DIR,'Slim4\\aupTemp')
  129. ,NULL
  130. )
  131.  
  132. ,(
  133. 'Web'
  134. ,4
  135. ,NULL
  136. ,NULL
  137. ,NULL
  138. ,CONCAT(@main_DIR,'Slim4Web')
  139. ,CONCAT(@Main_DIR,'Slim4Web\\Archive')
  140. ,CONCAT(@Main_DIR,'Slim4Web\\aupTemp')
  141. ,NULL
  142. )
  143.  
  144. ,(
  145. 'Database'
  146. ,7
  147. ,NULL
  148. ,NULL
  149. ,NULL
  150. ,NULL
  151. ,NULL
  152. ,NULL
  153. ,NULL
  154. )
  155.  
  156. ,
  157. (
  158. 'Webclient'
  159. ,8
  160. ,NULL
  161. ,NULL
  162. ,NULL
  163. ,CONCAT(@main_DIR,'Slim4WebClient')
  164. ,CONCAT(@Main_DIR,'Slim4WebClient\\Archive')
  165. ,CONCAT(@Main_DIR,'Slim4Webclient\\aupTemp')
  166. ,NULL
  167. )
  168.  
  169. ,(
  170. 'App'
  171. ,9
  172. ,NULL
  173. ,NULL
  174. ,NULL
  175. ,CONCAT(@main_DIR,'Slim4App')
  176. ,CONCAT(@Main_DIR,'Slim4App\\Archive')
  177. ,CONCAT(@Main_DIR,'Slim4App\\aupTemp')
  178. ,NULL
  179. );
  180.  
  181. SELECT *
  182. FROM autoupgradecontrol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement