diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-09-10 13:42:41 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-09-10 13:42:41 +0300 |
commit | 381180bc27b7c4f0d54ca4a1599ad5d857a2086e (patch) | |
tree | 7fd9a727f7dccdc02648973d070c4eb1fa8fae6f /config | |
parent | 44261a5d9fd5b78f8a44fe330e2386525f4c3437 (diff) | |
download | gitlab-ce-381180bc27b7c4f0d54ca4a1599ad5d857a2086e.tar.gz |
remove gitlab_ci config
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab_ci.yml.example | 68 | ||||
-rw-r--r-- | config/gitlab_ci.yml.example.development | 19 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 24 | ||||
-rw-r--r-- | config/initializers/3_ci_settings.rb | 61 | ||||
-rw-r--r-- | config/initializers/4_ci_app.rb | 2 |
5 files changed, 24 insertions, 150 deletions
diff --git a/config/gitlab_ci.yml.example b/config/gitlab_ci.yml.example deleted file mode 100644 index dd33daa5578..00000000000 --- a/config/gitlab_ci.yml.example +++ /dev/null @@ -1,68 +0,0 @@ -# If you change this file in a Merge Request, please also create -# a MR on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests - -defaults: &defaults - gitlab_server: - url: 'https://gitlab.example.com/' # Replace with your gitlab server url - app_id: '' - app_secret: '' - - ## Gitlab CI settings - gitlab_ci: - ## Web server settings - host: localhost - port: 80 - https: false - - ## Email settings - # Email address used in the "From" field in mails sent by GitLab-CI - email_from: gitlab-ci@localhost - - # Email address of your support contact (default: same as email_from) - support_email: support@localhost - - # Default project notifications settings: - # - # Send emails only on broken builds (default: true) - # all_broken_builds: true - # - # Add pusher to recipients list (default: false) - # add_pusher: true - - # The location where build traces are stored (default: builds/). Relative paths are relative to Rails.root - # builds_path: builds/ - - ## Backup settings - backup: - path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) - # keep_time: 604800 # default: 0 (forever) (in seconds) - # upload: - # # Fog storage connection settings, see http://fog.io/storage/ . - # connection: - # provider: AWS - # region: eu-west-1 - # aws_access_key_id: AKIAKIAKI - # aws_secret_access_key: 'secret123' - # # The remote 'directory' to store your backups. For S3, this would be the bucket name. - # remote_directory: 'my.s3.bucket' - # # Use multipart uploads when file size reaches 100MB, see - # # http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html - # multipart_chunk_size: 104857600 - - -development: - <<: *defaults - -test: - <<: *defaults - gitlab_server: - url: 'http://demo.gitlab.com/' - app_id: 'id' - app_secret: 'secret' - gitlab_ci: - host: localhost - port: 80 - https: false - -production: - <<: *defaults diff --git a/config/gitlab_ci.yml.example.development b/config/gitlab_ci.yml.example.development deleted file mode 100644 index d23c4daf464..00000000000 --- a/config/gitlab_ci.yml.example.development +++ /dev/null @@ -1,19 +0,0 @@ -development: - gitlab_server: - url: 'http://localhost:3000' - app_id: '' - app_secret: '' - - gitlab_ci: - host: localhost - port: 9000 - https: false -test: - gitlab_server: - url: 'http://demo.gitlab.com/' - app_id: '' - app_secret: '' - gitlab_ci: - host: localhost - port: 80 - https: false diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 689c3f3049d..3893bd45cf5 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -18,7 +18,19 @@ class Settings < Settingslogic host.start_with?('www.') ? host[4..-1] : host end - private + def build_gitlab_ci_url + if gitlab_on_standard_port? + custom_port = nil + else + custom_port = ":#{gitlab.port}" + end + [ gitlab.protocol, + "://", + gitlab.host, + custom_port, + gitlab.relative_url_root + ].join('') + end def build_gitlab_shell_ssh_path_prefix if gitlab_shell.ssh_port != 22 @@ -160,6 +172,16 @@ Settings.gitlab['repository_downloads_path'] = File.absolute_path(Settings.gitla Settings.gitlab['restricted_signup_domains'] ||= [] Settings.gitlab['import_sources'] ||= ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git'] + +# +# CI +# +Settings['gitlab_ci'] ||= Settingslogic.new({}) +Settings.gitlab_ci['all_broken_builds'] = true if Settings.gitlab_ci['all_broken_builds'].nil? +Settings.gitlab_ci['add_pusher'] = false if Settings.gitlab_ci['add_pusher'].nil? +Settings.gitlab_ci['url'] ||= Settings.send(:build_gitlab_ci_url) +Settings.gitlab_ci['builds_path'] = File.expand_path(Settings.gitlab_ci['builds_path'] || "builds/", Rails.root + '/ci') + # # Reply by email # diff --git a/config/initializers/3_ci_settings.rb b/config/initializers/3_ci_settings.rb deleted file mode 100644 index 5cdff48d316..00000000000 --- a/config/initializers/3_ci_settings.rb +++ /dev/null @@ -1,61 +0,0 @@ -module Ci - class Settings < Settingslogic - source "#{Rails.root}/config/gitlab_ci.yml" - namespace Rails.env - - class << self - def gitlab_ci_on_non_standard_port? - ![443, 80].include?(gitlab_ci.port.to_i) - end - - private - - def build_gitlab_ci_url - if gitlab_ci_on_non_standard_port? - custom_port = ":#{gitlab_ci.port}" - else - custom_port = nil - end - [ gitlab_ci.protocol, - "://", - gitlab_ci.host, - custom_port, - gitlab_ci.relative_url_root - ].join('') - end - end - end -end - - -# -# GitlabCi -# -Ci::Settings['gitlab_ci'] ||= Settingslogic.new({}) -Ci::Settings.gitlab_ci['https'] = false if Ci::Settings.gitlab_ci['https'].nil? -Ci::Settings.gitlab_ci['host'] ||= 'localhost' -Ci::Settings.gitlab_ci['port'] ||= Ci::Settings.gitlab_ci.https ? 443 : 80 -Ci::Settings.gitlab_ci['relative_url_root'] ||= (ENV['RAILS_RELATIVE_URL_ROOT'] || '') + '/ci' -Ci::Settings.gitlab_ci['protocol'] ||= Ci::Settings.gitlab_ci.https ? "https" : "http" -Ci::Settings.gitlab_ci['email_from'] ||= "gitlab-ci@#{Ci::Settings.gitlab_ci.host}" -Ci::Settings.gitlab_ci['support_email'] ||= Ci::Settings.gitlab_ci.email_from -Ci::Settings.gitlab_ci['all_broken_builds'] = true if Ci::Settings.gitlab_ci['all_broken_builds'].nil? -Ci::Settings.gitlab_ci['add_pusher'] = false if Ci::Settings.gitlab_ci['add_pusher'].nil? -Ci::Settings.gitlab_ci['url'] ||= Ci::Settings.send(:build_gitlab_ci_url) -Ci::Settings.gitlab_ci['builds_path'] = File.expand_path(Ci::Settings.gitlab_ci['builds_path'] || "builds/", Rails.root + '/ci') - -# Compatibility with old config -Ci::Settings['gitlab_server_urls'] ||= Ci::Settings['allowed_gitlab_urls'] - -# -# Backup -# -Ci::Settings['backup'] ||= Settingslogic.new({}) -Ci::Settings.backup['keep_time'] ||= 0 -Ci::Settings.backup['path'] = File.expand_path(Ci::Settings.backup['path'] || "tmp/backups/", Rails.root) -Ci::Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'connection' => nil }) -# Convert upload connection settings to use symbol keys, to make Fog happy -if Ci::Settings.backup['upload']['connection'] - Ci::Settings.backup['upload']['connection'] = Hash[Ci::Settings.backup['upload']['connection'].map { |k, v| [k.to_sym, v] }] -end -Ci::Settings.backup['upload']['multipart_chunk_size'] ||= 104857600 diff --git a/config/initializers/4_ci_app.rb b/config/initializers/4_ci_app.rb index 60a30bf3bb7..cac8edb32bf 100644 --- a/config/initializers/4_ci_app.rb +++ b/config/initializers/4_ci_app.rb @@ -5,6 +5,6 @@ module GitlabCi REGISTRATION_TOKEN = SecureRandom.hex(10) def self.config - Ci::Settings + Settings end end |