Sha256: a4aa617d24438971df24429932955409098952c4bfed492e566efc1383fa80f3

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

require 'projectdx_pipeline/file'
require 'projectdx_pipeline/database_configuration_template'
namespace :pipeline do
  desc "Run commit stage build and tests"
  task :commit => 'commit:default'
  namespace :commit do
    task :default => %w(configure build test)
    task :configure
    task :build
    task :test

    namespace :configure do
      task :database do
        dct = ProjectdxPipeline::DatabaseConfigurationTemplate.new('config/database.pipeline.yml')
        dct.render_to_file('config/database.yml')
      end

      task :cms do
        ProjectdxPipeline::File.copy('config/cms_config.deploy.yml', 'config/cms_config.yml')
      end
    end

    namespace :build do
      task :clone_reference_database do
        config = YAML.load_file('config/database.yml')['development']
        pg = PGconn.new(:host => config['host'], :port => config['port'],
                        :user => config['username'], :password => config['password'],
                        :dbname => 'template1')
        pg.exec "DROP DATABASE IF EXISTS \"#{config['database']}\""
        pg.exec "CREATE DATABASE \"#{config['database']}\" TEMPLATE \"#{config['reference_db']}\""
        pg.close
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
projectdx_pipeline-1.2.2 lib/tasks/projectdx_pipeline.rake
projectdx_pipeline-1.2.1 lib/tasks/projectdx_pipeline.rake
projectdx_pipeline-1.2.0 lib/tasks/projectdx_pipeline.rake
projectdx_pipeline-1.1.0 lib/tasks/projectdx_pipeline.rake
projectdx_pipeline-1.0.0 lib/tasks/projectdx_pipeline.rake
projectdx_pipeline-0.2.0 lib/tasks/projectdx_pipeline.rake