• Jenkins_FileCenter_Beta_Deploy


    @ECHO OFF


    ECHO ***************************************************************************************************
    ECHO ********** Deploy FileCenter For Beta Environment *************************************************                               
    ECHO ***************************************************************************************************

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    ::::Init environment and check before deployment
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    IF %1]==] GOTO Usage
    IF %2]==] GOTO Usage
    IF %3]==] GOTO Usage


    SET @VersionNumber=%1
    SET @BackupBuildNumber=%2
    SET @IsBackup=%3
    SET @AppName=FileCenter
    SET @TargetAppName=%@AppName%_B
    SET @PackageName=%@AppName%-%@VersionNumber%.Latest.zip
    SET @AppInfo=%@AppName%/%@TargetAppName%/%@PackageName%
    SET @SourcePackageDir=\\morningstar.com\shares\DMRawData\JenkinsPackageFiles\DeployPackages\GPP\%@AppName%
    SET @TargetBackupDir=\\morningstar.com\shares\DMRawData\JenkinsPackageFiles\PackagesBackup
    SET @TargetDir=D$\Processes\Performance
    SET @TargetServerInfos=SZGFDEVAP13/1/1
    SET @TargetEnvironment=Beta
    SET @DependedStopServices=SZGFDEVRetrvAP11/DMWatchServices_DMBetaDownloader SZGFDEVAP11/DMWatchServices_Importer SZGFDEVAP12/DMWatchServices_Importer SZGFDEVAP11/DMWatchServices_Parser SZGFDEVAP12/DMWatchServices_Parser SZGFDEVAP13/DMWatchServices_FileCenter
    SET @DependedStartServices=SZGFDEVAP13/DMWatchServices_FileCenter SZGFDEVRetrvAP11/DMWatchServices_DMBetaDownloader SZGFDEVAP11/DMWatchServices_Importer SZGFDEVAP12/DMWatchServices_Importer SZGFDEVAP11/DMWatchServices_Parser SZGFDEVAP12/DMWatchServices_Parser


    ECHO ***************************************************************************************************
    ECHO ***** Check current environment info
    ECHO ***************************************************************************************************

    ECHO  ::AppName ----------------- %@AppName%
    ECHO  ::TargetAppName ----------- %@TargetAppName%
    ECHO  ::PackageName ------------- %@PackageName%
    ECHO  ::IsBackup ---------------- %@IsBackup%
    ECHO  ::PackageName ------------- %@PackageName%
    ECHO  ::SourcePackageDir -------- %@SourcePackageDir%
    ECHO  ::TargetBackupDir --------- %@TargetBackupDir%
    ECHO  ::TargetDir --------------- %@TargetDir%
    ECHO  ::TargetServerInfos ------- %@TargetServerInfos%
    ECHO  ::TargetEnvironment ------- %@TargetEnvironment%
    ECHO  ::DependedStopServices ---- %@DependedStopServices%
    ECHO  ::DependedStartServices --- %@DependedStartServices%

    ECHO ***************************************************************************************************
    ECHO ***** You can cancle it during 9 seconds
    ECHO ***************************************************************************************************
    FOR /l %%i in (1,1,9) DO (
    ECHO ***** Cancel it ? %%i seconds past ...
    PING 127.0.0.1 -n 2 > nul )

    ECHO ***************************************************************************************************
    ECHO ***** Stop related services
    ECHO ***************************************************************************************************

    FOR %%S IN (%@DependedStopServices%) DO ( CALL StopService.bat %%S  IF ERRORLEVEL 1  GOTO ExitError )

    ECHO ***************************************************************************************************
    ECHO ***** Deploy Applications
    ECHO ***************************************************************************************************

    FOR %%I IN (%@TargetServerInfos%) DO (
       CALL FileCenter_Deploy.bat  %@AppInfo% %@SourcePackageDir% %@IsBackup% %@BackupBuildNumber% %@TargetBackupDir% %@TargetDir% %%I %@TargetEnvironment%
       IF ERRORLEVEL 1 GOTO ExitError
    )

    ECHO ***************************************************************************************************
    ECHO ***** Start related services
    ECHO ***************************************************************************************************

    FOR %%S IN (%@DependedStartServices%) DO ( CALL StartService.bat %%S  IF ERRORLEVEL 1  GOTO ExitError )

    ECHO ***************************************************************************************************
    ECHO ***** Deployment finish
    ECHO ***************************************************************************************************:

    ECHO INFO : ## Deploy "%@AppName%" successfully
    EXIT /B 0

    :ExitError
    ECHO ***************************************************************************************************
    ECHO ***** Deployment finish
    ECHO ***************************************************************************************************

    ECHO Error : ** Deploy "%@AppName%" failed
    EXIT /B 1

    :Usage
    ECHO Usage: %0 VersionNumber BUILD_NUMBER IsBackup
    ECHO Example: %0 1.0.1 1 N

  • 相关阅读:
    pythonGUI-wxpython
    [转]谈谈 Mifare Classic 破解
    python-optparse模块给脚本增加参数选项
    [笔记]python
    mac伪装工具macchanger
    mitmproxy
    yersinia的DHCP池耗尽断网攻击
    kalilinux工具中文在线
    MSF内网渗透 扫描模块
    渗透测试的一些总结
  • 原文地址:https://www.cnblogs.com/flysun0311/p/2624709.html
Copyright © 2020-2023  润新知