Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

redeploy.bat 983B

123456789101112131415161718192021222324252627
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. REM redeploy.bat - trigger a remote deploy FROM YOUR LAPTOP (Windows).
  4. REM Double-click, or run from a terminal. Pass deploy.sh flags through:
  5. REM redeploy.bat pull latest + rebuild
  6. REM redeploy.bat --no-pull rebuild current checkout
  7. REM redeploy.bat --rollback restore newest backup on the server
  8. REM
  9. REM Password order: %DEPLOY_PASS% -> deploy.secret file -> prompt.
  10. set "HOST=118.95.33.89"
  11. set "PORT=61"
  12. set "USER=root"
  13. set "APPDIR=/opt/bizgaze-support"
  14. REM Locate plink
  15. set "PLINK=plink"
  16. where plink >nul 2>nul || set "PLINK=C:\Program Files\PuTTY\plink.exe"
  17. REM Resolve password
  18. set "PW=%DEPLOY_PASS%"
  19. if "!PW!"=="" if exist "%~dp0deploy.secret" set /p PW=<"%~dp0deploy.secret"
  20. if "!PW!"=="" set /p "PW=Server password for %USER%@%HOST%: "
  21. echo ==^> Triggering deploy on %USER%@%HOST% (%APPDIR%) ...
  22. "%PLINK%" -ssh -batch -P %PORT% -pw "!PW!" %USER%@%HOST% "cd %APPDIR% && bash deploy.sh %*"
  23. endlocal