script/seed.rb in pact_broker-2.79.1 vs script/seed.rb in pact_broker-2.80.0
- old
+ new
@@ -1,50 +1,50 @@
#!/usr/bin/env ruby
raise "Please supply database path" unless ARGV[0]
-$LOAD_PATH.unshift './lib'
-$LOAD_PATH.unshift './spec'
-$LOAD_PATH.unshift './tasks'
-ENV['RACK_ENV'] = 'development'
-require 'sequel'
-require 'logger'
-require 'stringio'
-logger = Logger.new($stdout)
+$LOAD_PATH.unshift "./lib"
+$LOAD_PATH.unshift "./spec"
+$LOAD_PATH.unshift "./tasks"
+ENV["RACK_ENV"] = "development"
+require "sequel"
+require "logger"
+require "stringio"
+# logger = Logger.new($stdout)
logger = Logger.new(StringIO.new)
-DATABASE_CREDENTIALS = {logger: logger, adapter: "sqlite", database: ARGV[0], :encoding => 'utf8'}.tap { |it| puts it }
+DATABASE_CREDENTIALS = {logger: logger, adapter: "sqlite", database: ARGV[0], :encoding => "utf8"}.tap { |it| puts it }
#DATABASE_CREDENTIALS = {adapter: "postgres", database: "pact_broker", username: 'pact_broker', password: 'pact_broker', :encoding => 'utf8'}
connection = Sequel.connect(DATABASE_CREDENTIALS)
connection.timezone = :utc
# Uncomment these lines to open a pry session for inspecting the database
# require 'pry'; pry(binding);
# exit
-require 'pact_broker/db'
+require "pact_broker/db"
PactBroker::DB.connection = connection
-require 'pact_broker'
-require 'support/test_data_builder'
+require "pact_broker"
+require "support/test_data_builder"
-require 'database/table_dependency_calculator'
+require "database/table_dependency_calculator"
PactBroker::Database::TableDependencyCalculator.call(connection).each do | table_name |
connection[table_name].delete
end
- # .create_webhook(method: 'GET', url: 'https://localhost:9393?url=${pactbroker.pactUrl}', body: '${pactbroker.pactUrl}')
+# .create_webhook(method: 'GET', url: 'https://localhost:9393?url=${pactbroker.pactUrl}', body: '${pactbroker.pactUrl}')
-webhook_body = {
- 'pactUrl' => '${pactbroker.pactUrl}',
- 'verificationResultUrl' => '${pactbroker.verificationResultUrl}',
- 'consumerVersionNumber' => '${pactbroker.consumerVersionNumber}',
- 'providerVersionNumber' => '${pactbroker.providerVersionNumber}',
- 'providerVersionTags' => '${pactbroker.providerVersionTags}',
- 'consumerVersionTags' => '${pactbroker.consumerVersionTags}',
- 'consumerName' => '${pactbroker.consumerName}',
- 'providerName' => '${pactbroker.providerName}',
- 'githubVerificationStatus' => '${pactbroker.githubVerificationStatus}'
-}
+# webhook_body = {
+# 'pactUrl' => '${pactbroker.pactUrl}',
+# 'verificationResultUrl' => '${pactbroker.verificationResultUrl}',
+# 'consumerVersionNumber' => '${pactbroker.consumerVersionNumber}',
+# 'providerVersionNumber' => '${pactbroker.providerVersionNumber}',
+# 'providerVersionTags' => '${pactbroker.providerVersionTags}',
+# 'consumerVersionTags' => '${pactbroker.consumerVersionTags}',
+# 'consumerName' => '${pactbroker.consumerName}',
+# 'providerName' => '${pactbroker.providerName}',
+# 'githubVerificationStatus' => '${pactbroker.githubVerificationStatus}'
+# }
PactBroker.configuration.base_equality_only_on_content_that_affects_verification_results = false
json_content = <<-HEREDOC
{