Sha256: 2acfde86112aa0fa4b718c506c9ad0100b198dc8ac7802aca29f0fbbd4ab78cd
Contents?: true
Size: 875 Bytes
Versions: 35
Compression:
Stored size: 875 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, 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
35 entries across 35 versions & 1 rubygems