Sha256: 886076f53fc53444214f98228d53216c947ec77f7ebd9c431aec8e0503723bde

Contents?: true

Size: 784 Bytes

Versions: 14

Compression:

Stored size: 784 Bytes

Contents

module Evrone
  module CI
    class Router
      class ScriptBuilder

        Databases = Struct.new(:app) do

          def call(env)
            psql = []
            psql << %{sudo -u postgres psql -q -h localhost -c "create role ci with login superuser password 'ci'" || true}
            psql << %{sudo -u postgres psql -q -h localhost -c "create database ci" || true}

            mysql = []

            mysql << %{echo "CREATE USER 'ci'@'localhost';" | mysql -u root }
            mysql << %{echo "GRANT ALL PRIVILEGES ON *.* TO 'ci'@'localhost';" | mysql -u root }

            env.init.tap do |i|
              psql.each {|c| i << c }
              mysql.each {|c| i << c }
            end

            app.call(env)
          end

        end
      end
    end
  end
end


Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
evrone-ci-router-0.2.0.pre28 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre27 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre26 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre25 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre24 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre23 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre22 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre21 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre20 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre19 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre18 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre17 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre15 lib/evrone/ci/router/script_builder/databases.rb
evrone-ci-router-0.2.0.pre14 lib/evrone/ci/router/script_builder/databases.rb