migration_bundler 1.3.3 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 331ed3c381241e82da71729430d7253327d6e1c3
4
- data.tar.gz: e02cb417b7d020507b36206213233dee91a82398
3
+ metadata.gz: 36e4348bd3caf4b23232f155720c1770e05504e9
4
+ data.tar.gz: a61b08bf83ad882b88f64e4c3d347435df21ac33
5
5
  SHA512:
6
- metadata.gz: caccacf22eaf5973a0aa691cc85ab523fa5ec5d55e8da9681a5af7bdc8a2a6d2e78132099aa16548584db4874c711da33d5c32e71c2188e2309e19a1760983b7
7
- data.tar.gz: 37393f5922377093adca3d389407a480f4d88b5a6b7dbd32593dabd034cf0ee350aaa8907477a94c7be4290ce1a23030b0bfdb96f7eef51512ea8e1a5f60ec74
6
+ metadata.gz: bfc856921867c5a43b46fb37e23636f63cbdd3be62deea5fac6b67a0b4ab08c4438dbf66bfbfc14a857b1299baa5eef52abf338edc018a938bfb75a11f3cecfe
7
+ data.tar.gz: 065b3593d3c7e627ac3038990f3e0eb4b9843a14f8f5649f73deb7b4c7c6f6c2fd57870723f207ae3c87d528dd65124cb52ffc112a06fe5dd214eb97df4ca17b
@@ -1,3 +1,8 @@
1
+ ## v1.4.0
2
+
3
+ * Introduces support for [gradle-git-repo-plugin](https://github.com/layerhq/gradle-git-repo-plugin) via the `maven_git` target.
4
+ This plugin provides support for the publication of Maven artifacts hosted in private Git repositories.
5
+
1
6
  ## v1.3.3
2
7
 
3
8
  * Fail if an attempt is made to determine tags with Git < 1.9.x
@@ -0,0 +1,60 @@
1
+ require 'migration_bundler/targets/base'
2
+
3
+ module MigrationBundler
4
+ module Targets
5
+ class MavenGitTarget < MigrationBundler::Targets::Base
6
+ def self.name
7
+ 'maven_git'
8
+ end
9
+
10
+ def init
11
+ unless project.config['maven_git.repo.name']
12
+ project.config['maven_git.repo.name'] = ask("What is the name of your Maven Github repo? ")
13
+ end
14
+ unless project.config['maven_git.org.name']
15
+ project.config['maven_git.org.name'] = ask("What is the name of your Github Organization? ")
16
+ end
17
+ end
18
+
19
+ def generate
20
+ invoke :validate
21
+ remove_file "project"
22
+ empty_directory "project"
23
+ empty_directory "project/src"
24
+ empty_directory "project/src/main"
25
+ empty_directory "project/src/main/resources"
26
+ empty_directory "project/src/main/resources/schema"
27
+
28
+ copy_file "project/build.gradle", "project/build.gradle"
29
+ FileUtils.cp_r project.schema_path, "project/src/main/resources/schema/schema.sql"
30
+ FileUtils.cp_r project.migrations_path, "project/src/main/resources"
31
+
32
+ version = unique_tag_for_version(migrations.latest_version)
33
+ run "cd project && gradle#{options['quiet'] && ' -q '} -Pversion=#{version} -PgitRepoHome='' -Prepo=#{maven_git_repo_name} -Porg=#{maven_git_org_name} clean jar"
34
+ end
35
+
36
+ def validate
37
+ fail Error, "Invalid configuration: maven_git.repo.name is not configured." unless maven_git_repo_name
38
+ fail Error, "Invalid configuration: maven_git.org.name is not configured." unless maven_git_org_name
39
+ end
40
+
41
+ def push
42
+ invoke :validate
43
+ version = project.git_latest_tag
44
+ Dir.mktmpdir do |temp_dir_path|
45
+ run "cd project && gradle#{options['quiet'] && ' -q'} -Pversion=#{version} -PgitRepoHome=#{temp_dir_path} -Prepo=#{maven_git_repo_name} -Porg=#{maven_git_org_name} publishToGithub"
46
+ end
47
+ end
48
+
49
+ private
50
+
51
+ def maven_git_repo_name
52
+ project.config['maven_git.repo.name']
53
+ end
54
+
55
+ def maven_git_org_name
56
+ project.config['maven_git.org.name']
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,6 @@
1
+ .gradle
2
+ /local.properties
3
+ /.idea/workspace.xml
4
+ .DS_Store
5
+ /build
6
+ /classes
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.1.1" type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
4
+ <output url="file://$MODULE_DIR$/build/classes/main" />
5
+ <output-test url="file://$MODULE_DIR$/build/classes/test" />
6
+ <exclude-output />
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
9
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
11
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
12
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
13
+ <excludeFolder url="file://$MODULE_DIR$/build" />
14
+ </content>
15
+ <orderEntry type="inheritedJdk" />
16
+ <orderEntry type="sourceFolder" forTests="false" />
17
+ </component>
18
+ </module>
19
+
@@ -0,0 +1,51 @@
1
+ apply plugin: 'java'
2
+ apply plugin: 'maven'
3
+ apply plugin: 'maven-publish'
4
+ apply plugin: 'git-repo'
5
+
6
+ /**
7
+ GIT_REPO_HOME
8
+ * Specify:
9
+ * -Pversion=[VERSION]
10
+ * -Purl=[MAVEN URL TO PUBLISH TO] e.g. "http://nexus.dev.layer.com:8081/nexus/content/repositories/releases" or "${System.env.HOME}/.m2/repository"
11
+ */
12
+
13
+ buildscript {
14
+ repositories {
15
+ maven { url "https://github.com/layerhq/releases-gradle/raw/master/releases" }
16
+ }
17
+ dependencies {
18
+ classpath group: 'com.layer', name: 'git-repo-plugin', version: '1.0.0'
19
+ }
20
+ }
21
+
22
+ compileJava {
23
+ sourceCompatibility = 1.6
24
+ targetCompatibility = 1.6
25
+ }
26
+
27
+ repositories {
28
+ mavenCentral()
29
+ }
30
+
31
+ /*************************************************
32
+ * Uploading
33
+ ************************************************/
34
+ task Jar(type: Jar) {
35
+ jar.archiveName = "migrationbundler-" + version + ".jar"
36
+ }
37
+
38
+ publishing {
39
+ publications {
40
+ mavenJava(MavenPublication) {
41
+ groupId "com.layer"
42
+ artifactId "migrationbundler"
43
+ from components.java
44
+ }
45
+ }
46
+ repositories {
47
+ maven {
48
+ url "file://${property("gitRepoHome")}/${property("org")}/${property("repo")}/releases"
49
+ }
50
+ }
51
+ }
@@ -5,7 +5,7 @@ require 'migration_bundler/version'
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'migration_bundler'
8
- s.version = '1.3.3'
8
+ s.version = '1.4.0'
9
9
  s.date = '2014-07-01'
10
10
  s.summary = "A flexible database schema management system."
11
11
  s.description = "Migration Bundler is a complete database schema management system providing migrations, dump/load, and packaging of schema artifacts."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Watters
@@ -187,6 +187,10 @@ files:
187
187
  - lib/migration_bundler/targets/maven/project/.gitignore
188
188
  - lib/migration_bundler/targets/maven/project/MonkeyButler.iml
189
189
  - lib/migration_bundler/targets/maven/project/build.gradle
190
+ - lib/migration_bundler/targets/maven_git/maven_git_target.rb
191
+ - lib/migration_bundler/targets/maven_git/project/.gitignore
192
+ - lib/migration_bundler/targets/maven_git/project/MonkeyButler.iml
193
+ - lib/migration_bundler/targets/maven_git/project/build.gradle
190
194
  - lib/migration_bundler/targets/sqlite/create_migration_bundler_tables.sql.erb
191
195
  - lib/migration_bundler/targets/sqlite/migration.sql.erb
192
196
  - lib/migration_bundler/targets/sqlite/sqlite_target.rb