Skip to content

Commit

Permalink
Quickstart windows support (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-software-pl authored Jul 31, 2024
1 parent 3cc45ef commit b012306
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
if [[ -n "$INPUT_NUSSKNACKER_VERSION" ]]; then
echo "NUSSKNACKER_VERSION=$INPUT_NUSSKNACKER_VERSION" > .env
fi
./start.sh || (docker-compose logs && exit 1)
./start.sh || (docker compose logs && exit 1)
- name: Clean up Quickstart
run: |
./stop-and-clean.sh
Expand Down
22 changes: 22 additions & 0 deletions download-and-start.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

set "BRANCH_NAME=%~1"
if "%BRANCH_NAME%"=="" set "BRANCH_NAME=main"

set "NU_QUICKSTART_DIR=nussknacker-quickstart-%BRANCH_NAME%"

powershell -Command "Invoke-WebRequest -Uri 'https://github.com/TouK/nussknacker-quickstart/archive/refs/heads/%BRANCH_NAME%.zip' -OutFile '%NU_QUICKSTART_DIR%.zip'"

if exist "%NU_QUICKSTART_DIR%" (
rd /s /q "%NU_QUICKSTART_DIR%"
)

powershell -Command "Expand-Archive -Path '%NU_QUICKSTART_DIR%.zip' -DestinationPath ."

cd "%NU_QUICKSTART_DIR%"

call start.bat

endlocal
30 changes: 30 additions & 0 deletions start.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

echo Running Nussknacker Quickstart ...
echo.

docker --version >nul 2>&1
if errorlevel 1 (
echo No Docker found. Docker is required to run this Quickstart. See https://docs.docker.com/engine/install/
exit /b 1
)

docker compose version >nul 2>&1
if errorlevel 1 (
echo No docker compose found. It seems you have to upgrade your Docker installation. See https://docs.docker.com/engine/install/
exit /b 2
)

docker compose config >nul 2>&1
if errorlevel 1 (
echo Cannot validate docker compose configuration. It seems you have to upgrade your Docker installation. See https://docs.docker.com/engine/install/
exit /b 3
)

docker compose up -d --build --wait

echo.
echo Nussknacker and its dependencies are up and running.
echo Open http://localhost:8080 and log in as admin:admin ...
30 changes: 30 additions & 0 deletions stop-and-clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@echo off
setlocal enabledelayedexpansion

cd /d "%~dp0"

echo Running Nussknacker Quickstart clean up ...
echo.

docker --version >nul 2>&1
if errorlevel 1 (
echo No Docker found. Docker is required to run this Quickstart. See https://docs.docker.com/engine/install/
exit /b 1
)

docker compose version >nul 2>&1
if errorlevel 1 (
echo No docker compose found. It seems you have to upgrade your Docker installation. See https://docs.docker.com/engine/install/
exit /b 2
)

docker compose config >nul 2>&1
if errorlevel 1 (
echo Cannot validate docker compose configuration. It seems you have to upgrade your Docker installation. See https://docs.docker.com/engine/install/
exit /b 3
)

docker compose down -v

echo All is cleaned. Goodbye

0 comments on commit b012306

Please sign in to comment.