Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @main_DIR NVARCHAR(max)
- DECLARE @service NVARCHAR(max)
- DECLARE @API NVARCHAR(max)
- DECLARE @apiSocket INT
- --Please fill in the correct values below:--
- -- --
- -- --
- -- --
- -- --
- --
- ----------------------------------------------------------------------
- --please Type the correct path and !! do use double backslashes !!
- set @main_DIR ='C:\\Program Files (x86)\\Slimstock\\Slim4_RTH_TEST\\'
- --please Type the correct Service Name
- set @service ='Slim4_RTH_TEST'
- --API socket info / Please fill in the correct socket--
- set @apiSocket =8062
- ----------------------------------------------------------------------
- --API info !DO NOT ALTER!--
- set @API = (select bladeId from BladeControl where bladeId = 'API')
- ;
- TRUNCATE TABLE autoupgradecontrol;
- --Master/slave/api insert--
- INSERT INTO autoupgradecontrol (
- aupentity
- ,aupentitytype
- ,aupentityhost
- ,aupentitysocket
- ,aupEntityServiceName
- ,aupentityinstalldir
- ,aupupgradearchivedir
- ,aupupgradeworkingdir
- ,aupbotservicename
- )
- select bladeId
- , bladeType
- , bladeHost
- , bladeSocket
- , @service
- , concat(@main_DIR,'slim4server')
- , concat(@main_DIR,'slim4server\\Archive')
- , concat(@main_DIR,'slim4server\\aupTemp')
- , concat(@service,'_Update')
- from BladeControl where bladeId not like 'API%'
- ;
- --insert API Server
- IF @API = 'API'
- BEGIN
- INSERT INTO autoupgradecontrol (
- aupentity
- ,aupentitytype
- ,aupentityhost
- ,aupentitysocket
- ,aupEntityServiceName
- ,aupentityinstalldir
- ,aupupgradearchivedir
- ,aupupgradeworkingdir
- ,aupbotservicename
- )
- select bladeId
- , bladeType
- , bladeHost
- , bladeSocket
- , @service
- , concat(@main_DIR,'slim4server')
- , concat(@main_DIR,'slim4server\\Archive')
- , concat(@main_DIR,'slim4server\\aupTemp')
- , concat(@service,'_Update')
- from BladeControl where bladeId = 'API'
- END
- ELSE
- begin
- INSERT INTO autoupgradecontrol (
- aupentity
- ,aupentitytype
- ,aupentityhost
- ,aupentitysocket
- ,aupEntityServiceName
- ,aupentityinstalldir
- ,aupupgradearchivedir
- ,aupupgradeworkingdir
- ,aupbotservicename
- )
- select 'API'
- , null
- , null
- , null
- , @service
- , concat(@main_DIR,'slim4server')
- , concat(@main_DIR,'slim4server\\Archive')
- , concat(@main_DIR,'slim4server\\aupTemp')
- , concat(@service,'_Update')
- END
- ;
- --API adjustment--
- update AutoUpgradeControl set aupEntityServiceName=CONCAT(@service,'_API'),
- aupentityhost='localhost', aupentitytype=2, aupEntitySocket=@apiSocket where aupentity='API'
- ;
- --Core server adjustment--
- --update AutoUpgradeControl set aupEntityServiceName=CONCAT(@service,'_PRD') where aupentity='MASTER' --
- --Client, Web, Database, Webclient, App insert--
- INSERT INTO autoupgradecontrol (
- aupentity
- ,aupentitytype
- ,aupentityhost
- ,aupentitysocket
- ,aupEntityServiceName
- ,aupentityinstalldir
- ,aupupgradearchivedir
- ,aupupgradeworkingdir
- ,aupbotservicename
- )
- VALUES
- (
- 'Client'
- ,3
- ,NULL
- ,NULL
- ,NULL
- ,CONCAT(@main_DIR,'slim4')
- ,CONCAT(@Main_DIR,'Slim4\\Archive')
- ,CONCAT(@Main_DIR,'Slim4\\aupTemp')
- ,NULL
- )
- ,(
- 'Web'
- ,4
- ,NULL
- ,NULL
- ,NULL
- ,CONCAT(@main_DIR,'Slim4Web')
- ,CONCAT(@Main_DIR,'Slim4Web\\Archive')
- ,CONCAT(@Main_DIR,'Slim4Web\\aupTemp')
- ,NULL
- )
- ,(
- 'Database'
- ,7
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- )
- ,
- (
- 'Webclient'
- ,8
- ,NULL
- ,NULL
- ,NULL
- ,CONCAT(@main_DIR,'Slim4WebClient')
- ,CONCAT(@Main_DIR,'Slim4WebClient\\Archive')
- ,CONCAT(@Main_DIR,'Slim4Webclient\\aupTemp')
- ,NULL
- )
- ,(
- 'App'
- ,9
- ,NULL
- ,NULL
- ,NULL
- ,CONCAT(@main_DIR,'Slim4App')
- ,CONCAT(@Main_DIR,'Slim4App\\Archive')
- ,CONCAT(@Main_DIR,'Slim4App\\aupTemp')
- ,NULL
- );
- SELECT *
- FROM autoupgradecontrol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement