class MigrationBundler::Targets::MavenTarget
Public Instance Methods
generate()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 18 def generate invoke :validate remove_file "project" empty_directory "project" empty_directory "project/src" empty_directory "project/src/main" empty_directory "project/src/main/resources" empty_directory "project/src/main/resources/schema" copy_file "project/build.gradle", "project/build.gradle" FileUtils.cp_r project.schema_path, "project/src/main/resources/schema/schema.sql" FileUtils.cp_r project.migrations_path, "project/src/main/resources" version = unique_tag_for_version(migrations.latest_version) run "cd project && gradle#{options['quiet'] && ' -q '} -Pversion=#{version} clean jar" end
init()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 6 def init unless project.config['maven.url'] project.config['maven.url'] = ask("What is the URL of your Java Maven repo? ") end unless project.config['maven.username'] project.config['maven.username'] = ask("What is the username for your Java Maven repo? ") end unless project.config['maven.password'] project.config['maven.password'] = ask("What is the password for your Java Maven repo? ") end end
push()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 41 def push invoke :validate version = project.git_latest_tag run "cd project && gradle#{options['quiet'] && ' -q'} -Pversion=#{version} -Purl=#{maven_url} -Pusername=#{maven_username} -Ppassword=#{maven_password} publish" end
validate()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 35 def validate fail Error, "Invalid configuration: maven.repo is not configured." unless maven_url fail Error, "Invalid configuration: maven.username is not configured." unless maven_username fail Error, "Invalid configuration: maven.password is not configured." unless maven_password end
Private Instance Methods
maven_password()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 57 def maven_password project.config['maven.password'] end
maven_url()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 49 def maven_url project.config['maven.url'] end
maven_username()
click to toggle source
# File lib/migration_bundler/targets/maven/maven_target.rb, line 53 def maven_username project.config['maven.username'] end