Sha256: bbf29da73fcc629c40ae1dfdd8b33d96d7e2b54d1a61c4f0b6dfb3b8b3c8d2ce
Contents?: true
Size: 887 Bytes
Versions: 71
Compression:
Stored size: 887 Bytes
Contents
module Gitlab module QA module Component class PostgreSQL < Base DOCKER_IMAGE = 'postgres'.freeze DOCKER_IMAGE_TAG = '11'.freeze def name @name ||= "postgres" end def start @docker.run(image: image, tag: tag) do |command| command << "-d" command << "--name #{name}" command << "--net #{network}" command.env("POSTGRES_PASSWORD", "SQL_PASSWORD") end end def run_psql(command) @docker.exec(name, %(psql -U postgres #{command})) end private def wait_until_ready start = Time.now begin run_psql 'template1' rescue StandardError sleep 5 retry if Time.now - start < 60 raise end end end end end end
Version data entries
71 entries across 71 versions & 1 rubygems