forked from liquibase/liquibase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vagrant box creation: Created Database config classes. Merged liquiba…
…se-sdk module into main liquibase-core
- Loading branch information
Showing
39 changed files
with
612 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
liquibase-core/src/main/java/liquibase/database/core/config/DB2ConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
import java.util.Arrays; | ||
import java.util.Set; | ||
|
||
public class DB2ConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "db2"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:db2://"+ getHostname() +":50000/lqbase"; | ||
} | ||
|
||
@Override | ||
public String getVagrantBoxName() { | ||
return "linux.centos.6_4"; | ||
} | ||
|
||
@Override | ||
public Set<String> getRequiredPackages(String vagrantBoxName) { | ||
Set<String> requiredPackages = super.getRequiredPackages(vagrantBoxName); | ||
requiredPackages.addAll(Arrays.asList("compat-libstdc++-33", "pam.i686", "numactl")); | ||
|
||
return requiredPackages; | ||
} | ||
|
||
@Override | ||
public String getPuppetInit(String box) { | ||
return "Package <| |> -> Exec['unzip db2']\n" + | ||
"\n" + | ||
"exec {'unzip db2':\n" + | ||
" command => '/bin/tar xfzv /install/db2/*expc.tar.gz',\n"+ | ||
" cwd => '/install/db2/',\n" + | ||
" creates => '/install/db2/expc/',\n" + | ||
" path => ['/usr/bin', '/usr/sbin', '/bin'],\n" + | ||
"}\n" + | ||
"\n" + | ||
"exec {'/install/db2/expc/db2setup -r /install/db2/db2expc.rsp':\n"+ | ||
" require => [Exec['unzip db2'], User['liquibase'],\n"+ | ||
" cwd => '/install/db2/expc',\n"+ | ||
" creates => '/opt/ibm/db2/',\n" + | ||
" path => ['/usr/bin', '/usr/sbin', '/bin'],\n" + | ||
"}\n"; | ||
} | ||
|
||
// @Override | ||
// public Set<String> getRequiredPackages() { | ||
// Set<String> requiredPackages = super.getRequiredPackages(); | ||
// requiredPackages.addAll(Arrays.asList("lib32stdc++6")); | ||
// | ||
// return requiredPackages; | ||
// } | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
liquibase-core/src/main/java/liquibase/database/core/config/DerbyConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
public class DerbyConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "derby"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:derby:liquibase;create=true"; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
liquibase-core/src/main/java/liquibase/database/core/config/FirebirdConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
public class FirebirdConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "firebird"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:firebirdsql:"+ getDatabaseShortName() +"/3050:c:\\firebird\\liquibase.fdb"; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
liquibase-core/src/main/java/liquibase/database/core/config/H2ConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
public class H2ConfigStandard extends ConnectionConfiguration { | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getDatabaseShortName() { | ||
return "h2"; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:h2:mem:liquibase"; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
liquibase-core/src/main/java/liquibase/database/core/config/HsqlConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
public class HsqlConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "hsqldb"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:hsqldb:mem:liquibase"; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
liquibase-core/src/main/java/liquibase/database/core/config/InformixConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
public class InformixConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "informix"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:informix-sqli://" + getHostname() + ":9088/liquibase:informixserver=ol_ids_1150_1"; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
liquibase-core/src/main/java/liquibase/database/core/config/MSSQLConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
public class MSSQLConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "mssql"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getVagrantBoxName() { | ||
return "windows"; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:sqlserver://"+ getHostname() +":1433;databaseName=liquibase"; | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
liquibase-core/src/main/java/liquibase/database/core/config/MySQLConfigStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package liquibase.database.core.config; | ||
|
||
import liquibase.sdk.supplier.database.ConnectionConfiguration; | ||
|
||
import java.util.Set; | ||
|
||
public class MySQLConfigStandard extends ConnectionConfiguration { | ||
@Override | ||
public String getDatabaseShortName() { | ||
return "mysql"; | ||
} | ||
|
||
@Override | ||
public String getConfigurationName() { | ||
return NAME_STANDARD; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return "jdbc:mysql://"+ getHostname() +"/liquibase"; | ||
} | ||
|
||
@Override | ||
public Set<String> getPuppetModules() { | ||
Set<String> modules = super.getPuppetModules(); | ||
modules.add("puppetlabs/mysql"); | ||
return modules; | ||
} | ||
|
||
@Override | ||
public Set<String> getRequiredPackages(String vagrantBoxName) { | ||
return super.getRequiredPackages(vagrantBoxName); | ||
} | ||
|
||
@Override | ||
public String getPuppetInit(String box) { | ||
return "class { '::mysql::server':\n" + | ||
" root_password => 'root',\n"+ | ||
(getVersion() == null ? "" : " package_ensure => '"+getVersion()+"',\n")+ | ||
" override_options => { 'mysqld' => { 'bind_address' => '0.0.0.0' } }, \n" + | ||
"}\n" + | ||
"\n" + | ||
"mysql::db { '"+getPrimaryCatalog()+"':\n" + | ||
" user => '"+ getDatabaseUsername()+"',\n" + | ||
" password => '"+ getDatabasePassword()+"',\n" + | ||
" host => '%',\n" + | ||
" grant => ['all'],\n" + | ||
"}\n" + | ||
"\n" + | ||
"mysql::db { '"+getAlternateCatalog()+"':\n" + | ||
" user => '"+ getAlternateUsername()+"',\n" + | ||
" password => '"+ getAlternateUserPassword()+"',\n" + | ||
" host => '%',\n" + | ||
" grant => ['all'],\n" + | ||
"}\n"; | ||
|
||
} | ||
} |
Oops, something went wrong.