-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcr_deploy.cmd
35 lines (26 loc) · 1.08 KB
/
cr_deploy.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@ECHO OFF
if "%~1"=="" (
echo Usage: %0% ^<deployment^>
exit /b 1
)
set DEPLOYMENT_ENVIRONMENT=%1
echo DEPLOYMENT_ENVIRONMENT = %DEPLOYMENT_ENVIRONMENT%
set VAR_FILENAME=deploy_config\vars\%DEPLOYMENT_ENVIRONMENT%.yml
echo VAR_FILENAME = %VAR_FILENAME%
if not exist %VAR_FILENAME% (
echo %VAR_FILENAME% does not exist, please copy deploy_config\vars\example.yml to %VAR_FILENAME% and fill in your secrets.
exit /b 1
)
REM Optional: use the latest git commit hash to set the version signature,
REM so that the git commit can be linked in the CloudReactor dashboard.
REM Otherwise, ansible will compute the task version signature as the
REM timestamp when it was started.
REM You can comment out the next block if you don't use git.
git rev-parse HEAD > commit_hash.txt
set /p CLOUDREACTOR_TASK_VERSION_SIGNATURE= < commit_hash.txt
del commit_hash.txt
echo CLOUDREACTOR_TASK_VERSION_SIGNATURE = %CLOUDREACTOR_TASK_VERSION_SIGNATURE%
REM End Optional
type nul >> deploy.env
type nul >> "deploy.%DEPLOYMENT_ENVIRONMENT%.env"
docker compose -f docker-compose-deployer.yml run --rm deploy %*