We've all got used to various maven features that we have come to rely on, and in my effort to migrate to Gradle I have endeavoured to find alternative replacments, one of which is the parent POM functionality. Gradle does not natively have this feature that as Maven users we rely on. Workarounds There are a number of workarounds documented, firstly the most common is to use the apply from to load a file from a URI (you can use a URL) but this is not ideal for many reasons. The alternative is to write your own plugin that alters your build.gradle file. Anorakgirl has a great write-up on how to do this here Gradle and the parent POM and is the inspiration for my plugin. Gradle pater-build plugin I love Anorakgirls write up but I was thinking that it really is a workaround and devs would need to start to understand the internal Gradle API, so if the apply from syntax has its short comings as Anorakgirl pointed out then how about subverting or working around them. I created
If you use Shippable as your Continuous Integration server on an open source project hosted on Github you will find that by default you cannot push any changes back to Github such as when you increment a version number and wish to push the changes back. This is because Shippable uses HTTPS for public Github repositories so trying to push changes back to it will require a username and password. Solution The solution is actually simple and requires two steps, firstly installing the the deployment key in your user or repository and then switching git over to ssh rather than https. Deployment key You can find your shippable deployment key on the right hand side of your account, this is a standard SSH public key, copy this key. You can either add this key to your repository or to your user (or another user if you so choose) that has access to your repositories. Be aware though that Github restricts the re-use of keys so if you add it to your repository then you can only have it
Migration number 1... CircleCI how did it go and what did I think? Well it was pretty smooth, the free tier worked pretty well. The configuration for a Java project was smaller than what I ended up with with Shippable (I could remove some of the boiler plate setup). The builds were significantly faster than Shippable. Initial implementation was quick to do, I like the way it walked me through creating the first configuration. however trying to refine it into something more robust took a fair amount of time and that is where I came across some of it's shortcomings: Workflows are a bit confusing, and whilst it seemed like they would be ideal for different flows for building and publishing the artefacts this ended up not being the case and it would have been simpler just to use jobs at the top level if it wasn't wanting to inject 'secrets' into the build. Unable to define a global setup step, this looks like what an 'orb' would be used for but ended up just sourci
Comments
Post a Comment