Sha256: 651c886f132650d90297f31c373562a0ef7f111de3a59bf0f10887e2c99b248a
Contents?: true
Size: 904 Bytes
Versions: 92
Compression:
Stored size: 904 Bytes
Contents
# frozen_string_literal: true module Gitlab module QA module Component class PostgreSQL < Base DOCKER_IMAGE = 'postgres' DOCKER_IMAGE_TAG = '11' 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
92 entries across 92 versions & 1 rubygems