5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-28 17:36:23 +00:00

Merge branch 'rails' into production.panel.sutty.nl

This commit is contained in:
f 2024-03-06 13:05:04 -03:00
commit a142abb3a6
No known key found for this signature in database
4 changed files with 15 additions and 10 deletions

View file

@ -1,5 +1,5 @@
.apk-add: &apk-add .apk-add: &apk-add
- "apk add go-task diffutils" - "apk add go-task diffutils gitlab_ci_log_section"
.disable-hainish: &disable-hainish .disable-hainish: &disable-hainish
- "rm -f .env.development" - "rm -f .env.development"
.cache-ruby: &cache-ruby .cache-ruby: &cache-ruby
@ -30,13 +30,18 @@ assets:
- *cache-node - *cache-node
- *cache-task - *cache-task
before_script: before_script:
- "gitlab_ci_log_section --name git --header=\"Configuring git\""
- "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\"" - "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\""
- "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\"" - "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\""
- "git remote set-url --push origin \"https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\"" - "git remote set-url --push origin \"https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\""
- "gitlab_ci_log_section --name git --end"
- "gitlab_ci_log_section --name apk --header=\"Installing dependencies\""
- "apk add brotli" - "apk add brotli"
- *apk-add - *apk-add
- *disable-hainish - *disable-hainish
- "gitlab_ci_log_section --name apk --end"
script: script:
- "gitlab_ci_log_section --name assets --header=\"Building\""
- "go-task assets" - "go-task assets"
after_script: after_script:
- "git add public && git commit -m \"ci: assets [skip ci]\"" - "git add public && git commit -m \"ci: assets [skip ci]\""

View file

@ -18,7 +18,8 @@ module ActiveStorage
# para que puedan propagarse correctamente a través de todo el # para que puedan propagarse correctamente a través de todo el
# stack. # stack.
def blob_args def blob_args
params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, metadata: {}).to_h.symbolize_keys.tap do |ba| params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type,
metadata: {}).to_h.symbolize_keys.tap do |ba|
ba[:filename] = ba[:filename].unicode_normalize.sub(/\A_+/, '') ba[:filename] = ba[:filename].unicode_normalize.sub(/\A_+/, '')
end end
end end

View file

@ -260,5 +260,10 @@ class Site
r&.success? r&.success?
end end
def lfs_cleanup
git_sh("git", "lfs", "prune")
git_sh("git", "lfs", "dedup")
end
end end
end end

View file

@ -31,7 +31,7 @@ class CleanupService
site.deploys.find_each(&:cleanup!) site.deploys.find_each(&:cleanup!)
site.repository.gc site.repository.gc
lfs_cleanup site.repository.lfs_cleanup
site.touch site.touch
end end
end end
@ -46,14 +46,8 @@ class CleanupService
Rails.logger.info "Limpiando repositorio git de #{site.name}" Rails.logger.info "Limpiando repositorio git de #{site.name}"
site.repository.gc site.repository.gc
lfs_cleanup site.repository.lfs_cleanup
site.touch site.touch
end end
end end
private
def lfs_cleanup
site.repository.git_sh("git", "lfs", "prune")
site.repository.git_sh("git", "lfs", "dedup")
end
end end