• 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

  • 相关阅读:
    vue学习 基本简介,安装,示例,options
    python操作谷歌翻译
    Celery笔记
    nps内网穿透笔记
    初学django基础05 路由系统,django的请求与返回
    初学Django基础04 http|jsonresponse,filter模板过滤器,cvb与fvb
    计数二进制字符串
    字符串相加
    类与对象
    Arrays
  • 原文地址:https://www.cnblogs.com/flysun0311/p/2624709.html
Copyright © 2020-2023  润新知