mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 04:26:21 +00:00
fix: renombrar todos los repositorios remotos
This commit is contained in:
parent
62eb5ddaa2
commit
69e1664084
1 changed files with 18 additions and 0 deletions
18
db/migrate/20230921155401_site_rename_origin_to_upstream.rb
Normal file
18
db/migrate/20230921155401_site_rename_origin_to_upstream.rb
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Renombrar todos los repositorios que apunten a skel como su origin
|
||||||
|
class SiteRenameOriginToUpstream < ActiveRecord::Migration[6.1]
|
||||||
|
# Renombrar
|
||||||
|
def up
|
||||||
|
Site.find_each do |site|
|
||||||
|
next unless site.repository.origin&.url == ENV['SKEL_SUTTY']
|
||||||
|
|
||||||
|
site.repository.rugged.remotes.rename('origin', 'upstream')
|
||||||
|
rescue Rugged::Error => e
|
||||||
|
Rails.logger.warn "#{site.name}: #{e.message}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# No se puede deshacer
|
||||||
|
def down; end
|
||||||
|
end
|
Loading…
Reference in a new issue