mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-20 09:01:45 +01:00
Move mastodon version config to config_for
yml (#33577)
This commit is contained in:
parent
87849d739e
commit
7c56517c7c
@ -2,6 +2,10 @@
|
|||||||
shared:
|
shared:
|
||||||
self_destruct_value: <%= ENV.fetch('SELF_DESTRUCT', nil) %>
|
self_destruct_value: <%= ENV.fetch('SELF_DESTRUCT', nil) %>
|
||||||
software_update_url: <%= ENV.fetch('UPDATE_CHECK_URL', 'https://api.joinmastodon.org/update-check') %>
|
software_update_url: <%= ENV.fetch('UPDATE_CHECK_URL', 'https://api.joinmastodon.org/update-check') %>
|
||||||
|
source:
|
||||||
|
base_url: <%= ENV.fetch('SOURCE_BASE_URL', nil) %>
|
||||||
|
repository: <%= ENV.fetch('GITHUB_REPOSITORY', 'mastodon/mastodon') %>
|
||||||
|
tag: <%= ENV.fetch('SOURCE_TAG', nil) %>
|
||||||
version:
|
version:
|
||||||
metadata: <%= ENV.fetch('MASTODON_VERSION_METADATA', nil) %>
|
metadata: <%= ENV.fetch('MASTODON_VERSION_METADATA', nil) %>
|
||||||
prerelease: <%= ENV.fetch('MASTODON_VERSION_PRERELEASE', nil) %>
|
prerelease: <%= ENV.fetch('MASTODON_VERSION_PRERELEASE', nil) %>
|
||||||
|
@ -50,16 +50,16 @@ module Mastodon
|
|||||||
end
|
end
|
||||||
|
|
||||||
def repository
|
def repository
|
||||||
ENV.fetch('GITHUB_REPOSITORY', 'mastodon/mastodon')
|
source_configuration[:repository]
|
||||||
end
|
end
|
||||||
|
|
||||||
def source_base_url
|
def source_base_url
|
||||||
ENV.fetch('SOURCE_BASE_URL', "https://github.com/#{repository}")
|
source_configuration[:base_url] || "https://github.com/#{repository}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# specify git tag or commit hash here
|
# specify git tag or commit hash here
|
||||||
def source_tag
|
def source_tag
|
||||||
ENV.fetch('SOURCE_TAG', nil)
|
source_configuration[:tag]
|
||||||
end
|
end
|
||||||
|
|
||||||
def source_url
|
def source_url
|
||||||
@ -79,7 +79,15 @@ module Mastodon
|
|||||||
end
|
end
|
||||||
|
|
||||||
def version_configuration
|
def version_configuration
|
||||||
Rails.configuration.x.mastodon.version
|
mastodon_configuration.version
|
||||||
|
end
|
||||||
|
|
||||||
|
def source_configuration
|
||||||
|
mastodon_configuration.source
|
||||||
|
end
|
||||||
|
|
||||||
|
def mastodon_configuration
|
||||||
|
Rails.configuration.x.mastodon
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -68,6 +68,7 @@ RSpec.describe InstancePresenter do
|
|||||||
context 'with the GITHUB_REPOSITORY env variable set' do
|
context 'with the GITHUB_REPOSITORY env variable set' do
|
||||||
around do |example|
|
around do |example|
|
||||||
ClimateControl.modify GITHUB_REPOSITORY: 'other/repo' do
|
ClimateControl.modify GITHUB_REPOSITORY: 'other/repo' do
|
||||||
|
reload_configuration
|
||||||
example.run
|
example.run
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -80,6 +81,7 @@ RSpec.describe InstancePresenter do
|
|||||||
context 'without the GITHUB_REPOSITORY env variable set' do
|
context 'without the GITHUB_REPOSITORY env variable set' do
|
||||||
around do |example|
|
around do |example|
|
||||||
ClimateControl.modify GITHUB_REPOSITORY: nil do
|
ClimateControl.modify GITHUB_REPOSITORY: nil do
|
||||||
|
reload_configuration
|
||||||
example.run
|
example.run
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -88,6 +90,10 @@ RSpec.describe InstancePresenter do
|
|||||||
expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon')
|
expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def reload_configuration
|
||||||
|
Rails.configuration.x.mastodon = Rails.application.config_for(:mastodon)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#thumbnail' do
|
describe '#thumbnail' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user