WIP: Dodaj wsparcie dla Dockera #128

Draft
d33tah wants to merge 46 commits from d33tah/rentgen:develop into develop
2 changed files with 21 additions and 52 deletions
Showing only changes of commit 86f5c86f4f - Show all commits

View File

@ -41,58 +41,6 @@ Firefox: https://addons.mozilla.org/en-US/firefox/addon/rentgen/
3. Click _Load Temporary Add-on..._ button 3. Click _Load Temporary Add-on..._ button
4. Pick the zip archive from last step of build process. 4. Pick the zip archive from last step of build process.
## Docker Usage
### Build and extract artifacts directly
```bash
docker buildx build . --output artifacts
```
This will build the extension and extract the `.zip` file to the `artifacts/` directory.
### Build with tests (typecheck + lint)
```bash
docker build --target test -t rentgen-test .
```
### Traditional build (creates full development environment)
```bash
docker build -t rentgen .
docker run --rm rentgen ls -lh /app/web-ext-artifacts/
```
### Run commands in the container
```bash
docker run --rm rentgen npm run build:chrome
docker run --rm rentgen npm run typecheck
```
### Run extension in Firefox (headless)
```bash
docker build --target runtime -t rentgen-run .
docker run --rm -it rentgen-run
```
### Using docker-compose
```bash
docker compose up rentgen_check # Build only
docker compose up rentgen_run # Run in Firefox
docker compose up rentgen_verify # Build and verify with tests
```
### Using npm scripts (recommended for testing)
```bash
npm run docker:verify # Build, test, and verify extension (exits with error if verification fails)
npm run docker:clean # Clean up Docker resources
```
## Issue tracker ## Issue tracker
If you find a problem, please send us an email: kontakt@internet-czas-dzialac.pl If you find a problem, please send us an email: kontakt@internet-czas-dzialac.pl

21
tests/pre-commit Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# Pre-commit hook for Rentgen extension
# Builds and runs verification tests before allowing commit
set -e
echo "Running pre-commit checks..."
# Build all stages
echo "Building Docker images..."
docker compose build
# Run code quality checks (typecheck + lint)
echo "Running code quality checks..."
docker compose up --abort-on-container-exit --exit-code-from rentgen_check rentgen_check
# Run integration tests
echo "Running integration tests..."
docker compose up --abort-on-container-exit --exit-code-from rentgen_verify rentgen_verify
echo "✓ All pre-commit checks passed!"