Class: Pgtk::LiquibaseTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Pgtk::LiquibaseTask
- Defined in:
- lib/pgtk/liquibase_task.rb
Overview
Liquibase rake task.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2019-2026 Yegor Bugayenko
- License
-
MIT
Instance Attribute Summary collapse
-
#contexts ⇒ String
Liquibase contexts to apply.
-
#docker ⇒ Symbol
Use docker (set to either :never, :always, or :maybe).
-
#liquibase_version ⇒ String
Liquibase version to use.
-
#master ⇒ String
Path to Liquibase master XML file.
-
#name ⇒ Symbol
Task name.
-
#postgresql_version ⇒ String
PostgreSQL JDBC driver version to use.
-
#quiet ⇒ Boolean
Whether to suppress output.
-
#schema ⇒ String
Path to PG entire SQL schema file, which will be dumped and overwritten after all migrations.
-
#yaml ⇒ String+
Path to YAML file with PostgreSQL connection details.
Instance Method Summary collapse
-
#initialize(*args) {|Pgtk::LiquibaseTask, Object| ... } ⇒ LiquibaseTask
constructor
Initialize a new Liquibase task.
Constructor Details
#initialize(*args) {|Pgtk::LiquibaseTask, Object| ... } ⇒ LiquibaseTask
Initialize a new Liquibase task.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/pgtk/liquibase_task.rb', line 62 def initialize(*args, &task_block) super() @docker ||= :maybe @name = args.shift || :liquibase @quiet = false @contexts = '' @liquibase_version = '3.2.2' @postgresql_version = '42.7.0' desc 'Deploy Liquibase changes to the running PostgreSQL server' unless ::Rake.application.last_description task(name, *args) do |_, task_args| RakeFileUtils.send(:verbose, true) do yield(*[self, task_args].slice(0, task_block.arity)) if block_given? run end end end |
Instance Attribute Details
#contexts ⇒ String
Liquibase contexts to apply
52 53 54 |
# File 'lib/pgtk/liquibase_task.rb', line 52 def contexts @contexts end |
#docker ⇒ Symbol
Use docker (set to either :never, :always, or :maybe)
56 57 58 |
# File 'lib/pgtk/liquibase_task.rb', line 56 def docker @docker end |
#liquibase_version ⇒ String
Liquibase version to use
44 45 46 |
# File 'lib/pgtk/liquibase_task.rb', line 44 def liquibase_version @liquibase_version end |
#master ⇒ String
Path to Liquibase master XML file
28 29 30 |
# File 'lib/pgtk/liquibase_task.rb', line 28 def master @master end |
#name ⇒ Symbol
Task name
24 25 26 |
# File 'lib/pgtk/liquibase_task.rb', line 24 def name @name end |
#postgresql_version ⇒ String
PostgreSQL JDBC driver version to use
48 49 50 |
# File 'lib/pgtk/liquibase_task.rb', line 48 def postgresql_version @postgresql_version end |
#quiet ⇒ Boolean
Whether to suppress output
40 41 42 |
# File 'lib/pgtk/liquibase_task.rb', line 40 def quiet @quiet end |
#schema ⇒ String
Path to PG entire SQL schema file, which will be dumped and overwritten after all migrations
36 37 38 |
# File 'lib/pgtk/liquibase_task.rb', line 36 def schema @schema end |
#yaml ⇒ String+
Path to YAML file with PostgreSQL connection details
32 33 34 |
# File 'lib/pgtk/liquibase_task.rb', line 32 def yaml @yaml end |