Fix pre-commit script to properly handle multiple files and resolve ESLint warnings

This commit is contained in:
William Valentin
2025-09-07 13:34:39 -07:00
parent 8fa2d3fb60
commit 315303b120
33 changed files with 561 additions and 404 deletions

View File

@@ -159,23 +159,24 @@ Configure `DEPLOYMENT_WEBHOOK_URL` to receive notifications:
1. **Build Fails - Buildx Not Available**
```bash
# Ensure Docker Buildx is installed on runner
docker buildx version
```
```bash
# Ensure Docker Buildx is installed on runner
docker buildx version
```
2. **Registry Push Fails**
```bash
# Check GITEA_TOKEN has package write permissions
# Verify registry URL is correct
```
```bash
# Check GITEA_TOKEN has package write permissions
# Verify registry URL is correct
```
3. **Deployment Fails**
```bash
# Check environment variables are set
# Verify server has Docker/Kubernetes access
```
```bash
# Check environment variables are set
# Verify server has Docker/Kubernetes access
```
### Debug Commands

View File

@@ -56,12 +56,12 @@ target "app" {
"linux/amd64",
"linux/arm64"
]
tags = [
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:${TAG}",
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:latest"
]
args = {
VITE_COUCHDB_URL = "${VITE_COUCHDB_URL}"
VITE_COUCHDB_USER = "${VITE_COUCHDB_USER}"
@@ -71,12 +71,12 @@ target "app" {
VITE_GITHUB_CLIENT_ID = "${VITE_GITHUB_CLIENT_ID}"
NODE_ENV = "production"
}
# Gitea registry caching
cache-from = [
"type=registry,ref=${GITEA_REGISTRY}/${GITEA_REPOSITORY}:buildcache"
]
cache-to = [
"type=registry,ref=${GITEA_REGISTRY}/${GITEA_REPOSITORY}:buildcache,mode=max"
]
@@ -89,13 +89,13 @@ target "app-ci" {
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:${GITEA_SHA}",
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:latest"
]
# Enhanced CI-specific features
attest = [
"type=provenance,mode=max",
"type=sbom"
]
# CI registry push
output = ["type=registry"]
}
@@ -105,11 +105,11 @@ target "dev" {
inherits = ["app"]
platforms = ["linux/amd64"]
tags = ["rxminder:dev"]
# Local caching only
cache-from = ["type=registry,ref=${GITEA_REGISTRY}/${GITEA_REPOSITORY}:buildcache"]
cache-to = ["type=registry,ref=${GITEA_REGISTRY}/${GITEA_REPOSITORY}:buildcache"]
# Load locally instead of push
output = ["type=docker"]
}
@@ -117,13 +117,13 @@ target "dev" {
# Production target with full attestations
target "prod" {
inherits = ["app-ci"]
# Production-specific tags
tags = [
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:prod-${TAG}",
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:production"
]
# Full security attestations for production
attest = [
"type=provenance,mode=max",
@@ -135,12 +135,12 @@ target "prod" {
target "staging" {
inherits = ["app"]
platforms = ["linux/amd64"] # Single platform for staging
tags = [
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:staging-${TAG}",
"${GITEA_REGISTRY}/${GITEA_REPOSITORY}:staging"
]
# Staging-specific build args
args = {
VITE_COUCHDB_URL = "${VITE_COUCHDB_URL}"
@@ -151,6 +151,6 @@ target "staging" {
VITE_GITHUB_CLIENT_ID = "${VITE_GITHUB_CLIENT_ID}"
NODE_ENV = "staging"
}
output = ["type=registry"]
}