provision setup
This commit is contained in:
@@ -14,6 +14,11 @@
|
||||
// padding-top: 4.5rem;
|
||||
// }
|
||||
|
||||
#sx-menu-toggle {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.setting_nav{
|
||||
background-color: #2f5663;
|
||||
height: 53px;
|
||||
|
||||
45
config/initializers/mysql2_adapter.rb
Executable file
45
config/initializers/mysql2_adapter.rb
Executable file
@@ -0,0 +1,45 @@
|
||||
module ActiveRecord
|
||||
class Base
|
||||
# Overriding ActiveRecord::Base.mysql2_connection
|
||||
# method to allow passing options from database.yml
|
||||
#
|
||||
# Example of database.yml
|
||||
#
|
||||
# login: &login
|
||||
# socket: /tmp/mysql.sock
|
||||
# adapter: mysql2
|
||||
# host: localhost
|
||||
# encoding: utf8
|
||||
# flags: 131072
|
||||
#
|
||||
# @param [Hash] config hash that you define in your
|
||||
# database.yml
|
||||
# @return [Mysql2Adapter] new MySQL adapter object
|
||||
#
|
||||
def self.mysql2_connection(config)
|
||||
config[:username] = 'root' if config[:username].nil?
|
||||
|
||||
if Mysql2::Client.const_defined? :FOUND_ROWS
|
||||
config[:flags] = config[:flags] ? config[:flags] | Mysql2::Client::FOUND_ROWS : Mysql2::Client::FOUND_ROWS
|
||||
end
|
||||
|
||||
client = Mysql2::Client.new(config.symbolize_keys)
|
||||
options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], 0]
|
||||
ConnectionAdapters::Mysql2Adapter.new(client, logger, options, config)
|
||||
end
|
||||
end
|
||||
|
||||
# This method is for running stored procedures.
|
||||
#
|
||||
# @return [Hash]
|
||||
#
|
||||
def self.select_sp(sql, name = nil)
|
||||
connection = ActiveRecord::Base.connection
|
||||
begin
|
||||
connection.select_all(sql, name)
|
||||
rescue NoMethodError
|
||||
ensure
|
||||
connection.reconnect! unless connection.active?
|
||||
end
|
||||
end
|
||||
end
|
||||
6
config/initializers/secrets.rb
Executable file
6
config/initializers/secrets.rb
Executable file
@@ -0,0 +1,6 @@
|
||||
# config = YAML.load_file(Rails.root.join("config/smartsales.yml"))
|
||||
# config.fetch(Rails.env, {}).each do |key, value|
|
||||
# ENV[key.upcase] = value.to_s
|
||||
# end
|
||||
|
||||
SECRETS_CONFIG = YAML.load_file("#{Rails.root}/config/secrets.yml")[Rails.env]
|
||||
4
config/initializers/sx.rb
Normal file
4
config/initializers/sx.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
config = YAML.load_file(Rails.root.join("config/sx.yml"))
|
||||
config.fetch(Rails.env, {}).each do |key, value|
|
||||
ENV[key.upcase] = value.to_s
|
||||
end
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
development:
|
||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||
provision_key: siPExnkwlHvAXkyQERzAWhNDwpuvnbqsTXoEHaxc
|
||||
|
||||
test:
|
||||
secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0
|
||||
@@ -20,4 +21,5 @@ test:
|
||||
# instead read values from the environment.
|
||||
production:
|
||||
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
||||
provision_key: siPExnkwlHvAXkyQERzAWhNDwpuvnbqsTXoEHaxc
|
||||
|
||||
|
||||
13
config/sx.yml
Normal file
13
config/sx.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
development:
|
||||
server_mode: cloud #local
|
||||
sx_provision_url: http://192.168.1.75:3002/api
|
||||
|
||||
|
||||
test:
|
||||
sx_provision_url: secure.smartsales.asia/api
|
||||
|
||||
# Do not keep production secrets in the repository,
|
||||
# instead read values from the environment.
|
||||
production:
|
||||
server_mode: cloud
|
||||
sx_provision_url: secure.smartsales.asia/api
|
||||
Reference in New Issue
Block a user