Skip to content

Commit 5f6efee

Browse files
committed
really added setup.cmd
1 parent 6d42bd4 commit 5f6efee

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

.gitattributes

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Default: treat text as text, store LF in repo
2+
* text=auto eol=lf
3+
4+
# Unix/mac scripts must be LF (shebang-friendly)
5+
*.sh text eol=lf
6+
7+
# Windows batch/PowerShell can use CRLF locally
8+
*.cmd text eol=crlf
9+
*.bat text eol=crlf
10+
*.ps1 text eol=crlf
11+
12+
# Common text files — keep LF in repo
13+
*.md text eol=lf
14+
*.yml text eol=lf
15+
*.yaml text eol=lf
16+
*.json text eol=lf
17+
Dockerfile text eol=lf
18+
*.env text eol=lf
19+
20+
# Binary
21+
*.png -text
22+
*.jpg -text
23+
*.jpeg -text
24+
*.gif -text
25+
*.pdf -text
26+
*.zip -text

demo/sdlc-e2e/setup.cmd

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
@echo off
2+
setlocal EnableExtensions EnableDelayedExpansion
3+
4+
REM This script runs from outside the repo to avoid being deleted by git clean
5+
6+
REM set "REPO_ROOT=C:\Users\msmik\Documents\src\catalog-service-node"
7+
REM "SCRIPT_DIR=%REPO_ROOT%\demo\sdlc-e2e"
8+
REM cd /d "%REPO_ROOT%"
9+
10+
for /f "usebackq delims=" %%I in (`powershell -NoProfile -Command "(Get-Date).ToString('yyyyMMdd')"`) do set "DATE_STAMP=%%I"
11+
for /f "usebackq delims=" %%I in (`powershell -NoProfile -Command "$env:USERNAME.ToLower()"`) do set "SAFE_USER=%%I"
12+
set "BRANCH_NAME=demo-%DATE_STAMP%-%SAFE_USER%"
13+
14+
15+
16+
echo ==> Setting up branch a demo branch named %BRANCH_NAME%
17+
git clean -f
18+
git branch -D temp 2>nul || echo.
19+
git branch -D %BRANCH_NAME% 2>nul || echo.
20+
git checkout -b temp
21+
git branch -D main 2>nul || echo.
22+
git checkout main
23+
git branch -D temp 2>nul || echo.
24+
git pull
25+
git checkout -b %BRANCH_NAME%
26+
27+
echo ==> Applying patch and creating a commit
28+
powershell -NoProfile -Command "(Get-Content '%SCRIPT_DIR%\demo.patch' -Raw) -replace '`n', \"`r`n\" | Set-Content '%TEMP%\demo-windows.patch' -NoNewline"
29+
git apply --whitespace=fix "%TEMP%\demo-windows.patch"
30+
del "%TEMP%\demo-windows.patch" 2>nul
31+
git commit -am "Demo prep"
32+
33+
echo ==> Installing npm dependencies
34+
call npm install
35+
echo ==> npm install completed
36+
37+
echo ==> Downloading container images
38+
docker compose pull
39+
40+
echo ==> Deleting postgres:17.2 container image
41+
docker image rm postgres:17.2 2>nul || echo.
42+
43+
echo ==> Configuring DBC (if this fails, ask to be added to the dockerdevrel organization)
44+
docker buildx create --driver cloud dockerdevrel/demo-builder 2>nul || echo.
45+
docker buildx use cloud-dockerdevrel-demo-builder
46+
47+
echo ==> Configuring Scout
48+
docker scout config organization dockerdevrel
49+
50+
echo ==> Setup complete!

0 commit comments

Comments
 (0)