Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Default: treat text as text, store LF in repo
* text=auto eol=lf

# Unix/mac scripts must be LF (shebang-friendly)
*.sh text eol=lf

# Windows batch/PowerShell can use CRLF locally
*.cmd text eol=crlf
*.bat text eol=crlf
*.ps1 text eol=crlf

# Common text files — keep LF in repo
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.json text eol=lf
Dockerfile text eol=lf
*.env text eol=lf

# Binary
*.png -text
*.jpg -text
*.jpeg -text
*.gif -text
*.pdf -text
*.zip -text
50 changes: 50 additions & 0 deletions demo/sdlc-e2e/setup.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@echo off
setlocal EnableExtensions EnableDelayedExpansion

REM This script runs from outside the repo to avoid being deleted by git clean

REM set "REPO_ROOT=C:\Users\msmik\Documents\src\catalog-service-node"
REM "SCRIPT_DIR=%REPO_ROOT%\demo\sdlc-e2e"
REM cd /d "%REPO_ROOT%"

for /f "usebackq delims=" %%I in (`powershell -NoProfile -Command "(Get-Date).ToString('yyyyMMdd')"`) do set "DATE_STAMP=%%I"
for /f "usebackq delims=" %%I in (`powershell -NoProfile -Command "$env:USERNAME.ToLower()"`) do set "SAFE_USER=%%I"
set "BRANCH_NAME=demo-%DATE_STAMP%-%SAFE_USER%"



echo ==> Setting up branch a demo branch named %BRANCH_NAME%
git clean -f
git branch -D temp 2>nul || echo.
git branch -D %BRANCH_NAME% 2>nul || echo.
git checkout -b temp
git branch -D main 2>nul || echo.
git checkout main
git branch -D temp 2>nul || echo.
git pull
git checkout -b %BRANCH_NAME%

echo ==> Applying patch and creating a commit
powershell -NoProfile -Command "(Get-Content '%SCRIPT_DIR%\demo.patch' -Raw) -replace '`n', \"`r`n\" | Set-Content '%TEMP%\demo-windows.patch' -NoNewline"
git apply --whitespace=fix "%TEMP%\demo-windows.patch"
del "%TEMP%\demo-windows.patch" 2>nul
git commit -am "Demo prep"

echo ==> Installing npm dependencies
call npm install
echo ==> npm install completed

echo ==> Downloading container images
docker compose pull

echo ==> Deleting postgres:17.2 container image
docker image rm postgres:17.2 2>nul || echo.

echo ==> Configuring DBC (if this fails, ask to be added to the dockerdevrel organization)
docker buildx create --driver cloud dockerdevrel/demo-builder 2>nul || echo.
docker buildx use cloud-dockerdevrel-demo-builder

echo ==> Configuring Scout
docker scout config organization dockerdevrel

echo ==> Setup complete!
2 changes: 1 addition & 1 deletion demo/sdlc-e2e/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

REPO_ROOT=$(git rev-parse --show-toplevel)
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
Expand Down