Skip to content
Merged
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
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,19 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate release metadata
run: |
PREVIOUS_RELEASE_SHA=$(git rev-parse HEAD^ 2>/dev/null || true) \
node packages/backend/scripts/write-release-metadata.js packages/backend/release-metadata.json
- name: Build Docker image
run: docker build -f packages/backend/Dockerfile -t muzzle:ci .
run: |
docker build \
-f packages/backend/Dockerfile \
-t muzzle:ci \
.
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Generate release metadata
run: |
PREVIOUS_RELEASE_SHA="${{ github.event.before }}" \
node packages/backend/scripts/write-release-metadata.js packages/backend/release-metadata.json

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ coverage

# Backend specific
packages/backend/src/ormconfig.ts
packages/backend/release-metadata.json

# Legacy
history-upload-job/data
Expand Down
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ npm run build:frontend

```bash
# Build backend Docker image
docker build -f packages/backend/Dockerfile -t mocker-backend:latest .
docker build \
--build-arg PREVIOUS_RELEASE_SHA="$(git rev-parse HEAD^ 2>/dev/null || true)" \
-f packages/backend/Dockerfile \
-t mocker-backend:latest \
.

# Run Docker container
docker run -p 3000:3000 \
Expand Down Expand Up @@ -290,17 +294,24 @@ The script requires `bash`, `curl`, `grep`, `mktemp`, and `tr`. It reads environ

From the root directory, you can run:

| Command | Description |
| --------------------------------------------------------- | ------------------------------------ |
| `npm run start` | Start the backend development server |
| `npm run start:prod` | Start the backend in production mode |
| `npm run build` | Build all workspaces |
| `npm run build:backend` | Build only the backend |
| `npm run test` | Run tests across all workspaces |
| `npm run test:backend` | Run tests for the backend only |
| `npm run lint` | Lint all packages |
| `npm run lint:fix` | Lint and auto-fix issues |
| `docker build -f packages/backend/Dockerfile -t muzzle .` | Build the backend Docker image |
| Command | Description |
| ----------------------- | ------------------------------------ |
| `npm run start` | Start the backend development server |
| `npm run start:prod` | Start the backend in production mode |
| `npm run build` | Build all workspaces |
| `npm run build:backend` | Build only the backend |
| `npm run test` | Run tests across all workspaces |
| `npm run test:backend` | Run tests for the backend only |
| `npm run lint` | Lint all packages |
| `npm run lint:fix` | Lint and auto-fix issues |

To build the backend Docker image locally, first generate the release metadata, then build:

```bash
PREVIOUS_RELEASE_SHA="$(git rev-parse HEAD^ 2>/dev/null || true)" \
node packages/backend/scripts/write-release-metadata.js packages/backend/release-metadata.json
docker build -f packages/backend/Dockerfile -t muzzle .
```

You can also run workspace-specific commands using:

Expand Down
Loading
Loading