Skip to content

Commit

Permalink
add git cleanup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
inetol committed Oct 19, 2024
1 parent 17c01b8 commit 4837166
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

### Binary

- Download the [latest release](https://github.com/jspaste/backend/releases/latest)
- Uncompress to a new folder
- Download the [latest release](https://github.com/jspaste/backend/releases/latest) and uncompress it to a new folder
- Edit the `.env.example` file and rename it to `.env`
- Run the binary...

Expand All @@ -26,8 +25,13 @@ powershell -c ".\backend.exe"

### Container

- Pull latest image: `docker pull ghcr.io/jspaste/backend:latest`
- Run the container: `docker run -e DOCS_ENABLED=true -d -p 127.0.0.1:4000:4000 ghcr.io/jspaste/backend:latest`
- Pull latest image and run the container:

```shell
docker pull ghcr.io/jspaste/backend:latest
docker run -e DOCS_ENABLED=true -d -p 127.0.0.1:4000:4000 \
ghcr.io/jspaste/backend:latest
```

## Validate

Expand All @@ -42,8 +46,8 @@ gh attestation verify backend.tar.gz \
--owner JSPaste
```

Since container
version [`2024.05.06-e105023`](https://github.com/orgs/jspaste/packages/container/backend/212635273?tag=2024.05.06-e105023),
Since container version
[`2024.05.06-e105023`](https://github.com/orgs/jspaste/packages/container/backend/212635273?tag=2024.05.06-e105023),
images are attested and can be verified using the following command:

```shell
Expand All @@ -54,6 +58,17 @@ gh attestation verify oci://ghcr.io/jspaste/backend:latest \
You can verify the integrity and origin of an artifact and/or image using the GitHub CLI or manually
at [JSPaste Attestations](https://github.com/jspaste/backend/attestations).

## Development

### Maintenance

Over time, local repositories can become messy with untracked files, registered hooks, and temporary files in the .git
folder. To clean up the repository (and possibly all your uncommitted work), run the following command:

```shell
bun run clean:git:all
```

## License

This project is licensed under the EUPL License. See the [`LICENSE`](LICENSE) file for more details.
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
"scripts": {
"build": "bun run build:server",
"build:server": "rm -rf ./dist/ && bun build ./src/server.ts --outdir=./dist/ --target=bun --minify --sourcemap=inline",
"build:standalone": "rm -rf ./dist/ && bun build ./src/server.ts --outfile=./dist/backend --compile --minify --sourcemap=inline",
"build:standalone": "bun build ./src/server.ts --outfile=./dist/backend --compile --minify --sourcemap=inline",
"build:standalone:darwin-arm64": "bun run build:standalone -- --target=bun-darwin-arm64",
"build:standalone:linux-amd64": "bun run build:standalone -- --target=bun-linux-x64-modern",
"build:standalone:linux-arm64": "bun run build:standalone -- --target=bun-linux-arm64",
"build:standalone:windows-amd64": "bun run build:standalone -- --target=bun-windows-x64-modern",
"clean:git:all": "bun run clean:git:untracked && bun run clean:git:gc && bun run clean:git:hooks",
"clean:git:all:force": "bun run clean:git:untracked:force && bun run clean:git:gc && bun run clean:git:hooks",
"clean:git:gc": "git gc --aggressive --prune",
"clean:git:hooks": "rm -rf ./.git/hooks/ && bun install -f",
"clean:git:untracked": "git clean -d -x -i",
"clean:git:untracked:force": "git clean -d -x -f",
"dev": "bun run start:dev",
"fix": "bun run fix:biome; bun run fix:package",
"fix:biome": "bun biome check --write",
Expand Down

0 comments on commit 4837166

Please sign in to comment.