Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBT Plugin (Scala Simple Build Tool) #85

Closed
flyway opened this issue Jun 25, 2013 · 16 comments
Closed

SBT Plugin (Scala Simple Build Tool) #85

flyway opened this issue Jun 25, 2013 · 16 comments
Milestone

Comments

@ghost
Copy link
Collaborator

@ghost ghost commented Jun 25, 2013

Original author: christia...@gmail.com (July 27, 2011 22:11:12)

SBT Plugin

Original issue: http://code.google.com/p/flyway/issues/detail?id=147

@ghost
Copy link
Collaborator Author

@ghost ghost commented Jun 25, 2013

From sean8...@gmail.com on February 21, 2013 21:18:41
I wrote an SBT plugin for Flyway. You can check it out at: https://github.com/sean8223/flyway-sbt-plugin. Let me know if you find it useful.

@ghost
Copy link
Collaborator Author

@ghost ghost commented Jun 25, 2013

From axel.fontaine.business@gmail.com on February 22, 2013 10:21:01
Hi Sean,

thanks for contributing this. You are however not the first to attempt this. Christian already made significant inroads as you can see here: https://github.com/cdedie/flyway

These are the criteria I think are a must for inclusion in the main distribution:

  • integrates with the Flyway API (not the command line tool)
  • sticks to Flyway conventions as far as it makes sense
  • sticks to SBT conventions as far as it makes sense
  • is integrated into the main Maven build (mvn clean install in the root should also build the SBT plugin)
  • doesn't require the separate installation of SBT for the build to run (downloaded from Maven central on demand)
  • is well documented (supported SBT versions, commands and properties, website, ...)

I would recommend you two join forces and either discuss details for a common implementation here, or as part of a joint pull request.

Cheers
Axel

@ghost
Copy link
Collaborator Author

@ghost ghost commented Jun 25, 2013

From axel.fontaine.business@gmail.com on March 12, 2013 09:53:50
Hi Sean,

Christian now created a pull request: #12

Could you contribute to it and give us your thoughts/submit improvements?

Cheers
Axel

@guersam
Copy link

@guersam guersam commented Jun 25, 2013

+1

1 similar comment
@ramn
Copy link

@ramn ramn commented Jun 25, 2013

+1

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jul 13, 2013

Hi everyone,

Christian contributed an implementation which is now merged in master. There are however still some things I am not completely happy about including:

Please give the current implementation a spin. Any improvements/feedback welcome.

Cheers
Axel

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 31, 2013

Now that SBT 0.13 has been released, the code should be finalized and updated with the necessary changes. And then it's time to push this out the door!

Pull Request welcome. Any takers? @cdedie?

@LeifWarner
Copy link

@LeifWarner LeifWarner commented Sep 5, 2013

Thanks! I've been using the sbt plugin in master, and it seems to be working well. However, a couple things:

Configurability:

It'd be nice to have a way of accepting input; currently running against a different database or running a different group of migrations (we have migrations split into pre-release and post-release ones) involves editing the flywayUrl and flywayLocations settings in build.sbt, respectively. I made a "main" method that takes arguments for those things in a different classpath in SBT (http://www.scala-sbt.org/release/docs/Detailed-Topics/Testing.html#custom-test-configuration). That might work better for running migrations, anyways - if .scala migrations use other code from our app, that won't be available from SBT's classpath when running them from this plugin.

SBT 0.13:

The "large number of keys" SO post above becomes even more pressing on 0.13. I filed a ticket w/ SBT about it: sbt/sbt#857

Any suggestions for how I can help with this plugin, and getting it released?

@LeifWarner
Copy link

@LeifWarner LeifWarner commented Sep 5, 2013

Rather than having tons of separate string-valued SBT settings, what about grouping them together? If not a Map[String, String] like Sean had, how 'bout a Scala case class of typed values representing flyway config? And perhaps a variant of flyway tasks could be an InputTask taking arguments to modify values in that before running?

@LeifWarner
Copy link

@LeifWarner LeifWarner commented Sep 5, 2013

Also, the outOfOrder value doesn't seem referenced in the flyway setting, i.e. it has no effect.

@DWvanGeest
Copy link

@DWvanGeest DWvanGeest commented Sep 5, 2013

Would definitely like to give this a try. I'm new to SBT and Scala, but will do what I can.

I'm running SBT 0.13.0 and Scala 2.10.2. @axelfontaine, what's the easiest way to try out this plugin? I assume I need to be running code Flyway code from master...

@LeifWarner
Copy link

@LeifWarner LeifWarner commented Sep 5, 2013

You don't need to be running flyway from master. It won't currently work w/ SBT 0.13.0, only say 0.12.4. You can checkout this repo, and change the versions in pom.xml from 0-SNAPSHOT to 2.2.1. Then in the flyway-sbt-plugin directory, run "sbt publish-local" to published a built artifact to $HOME/.ivy2/local. Then you can included it in your project w/ addSbtPlugin("com.googlecode.flyway" %% "sbt-flyway" % "2.2.1") in your project/plugins.sbt

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Sep 10, 2013

Hi Leif,

thank you for the many comments and suggestions. I think the first step to getting the plugin released is the SBT 0.13 compatibility. Once that is through, we can then look at polishing up the remaining bits and writing the docs (getting started and reference).

Do you feel up for providing a first pull request for 0.13 compatibility?

Cheers
Axel

@LeifWarner
Copy link

@LeifWarner LeifWarner commented Sep 10, 2013

There's that max tuple length issue... I might have time this weekend to take a crack at something to work around that.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Dec 16, 2013

Merged @cdedie 's contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.