Deploying a ratpack app with Atlassian Bamboo

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying a ratpack app with Atlassian Bamboo

windlessuser
Hey all,

I plan to use ratpack for a project of mine. My company however requires me to use Atlassian Bamboo for our CI and Deployment. The project is going to be hosted with Heroku. Bamboo has a plugin that allow's it to upload a war to Heroku. I thought of using the git method illustrated here but that isn't possible as we use atlassian on demand so the code is built and deployed on a random machine; no way of controlling the ssh keys.

is there a way to setup a war task to spit out a war?
rus
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

rus

Is there a gradle deployment task available in bamboo? Maybe you could use that instead to do the deployment.

On 4 Feb 2014 20:07, "windlessuser [via Ratpack Forum]" <[hidden email]> wrote:
Hey all,

I plan to use ratpack for a project of mine. My company however requires me to use Atlassian Bamboo for our CI and Deployment. The project is going to be hosted with Heroku. Bamboo has a plugin that allow's it to upload a war to Heroku. I thought of using the git method illustrated here but that isn't possible as we use atlassian on demand so the code is built and deployed on a random machine; no way of controlling the ssh keys.

is there a way to setup a war task to spit out a war?


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/Deploying-a-ratpack-app-with-Atlassian-Bamboo-tp357.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
Unfortunately no. I just use gradle wrapper. I'd still need a war task in any case.
rus
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

rus

I might be wrong but I don't imagine there ever being a war task for ratpack. It seems to go against the grain to me, using a container and a war to bootstrap a framework with an embedded container. Unless you were trying to embed ratpack into an existing Web app maybe.

I haven't tried this but maybe you could create a web app, make your ratpack project a dependency and then bootstrap ratpack in a servlet initializer.

I think your best option though is to create a pull request for the bamboo heroku plugin adding fatjar deployment support :) I'd be happy to help if you get stuck.

On 4 Feb 2014 20:26, "windlessuser [via Ratpack Forum]" <[hidden email]> wrote:
Unfortunately no. I just use gradle wrapper. I'd still need a war task in any case.


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/Deploying-a-ratpack-app-with-Atlassian-Bamboo-tp357p359.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Luke Daley
Administrator
In reply to this post by windlessuser
Hi there,

Ratpack apps can't be packaged as WARs as they don't conform to that spec. I had a quick look at the Bamboo Heroku plugin and it looks like it only supports WARs, so that's a bust.

What we do for the Ratpack site is deploy to Heroku in source form. What you'd need to do here is have Bamboo push your code to Heroku's Git repo at the end of a successful build. Would that work for you?
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
Phew,

After some work and ssh fu. I finally got Bamboo to this step:

Warning: Permanently added 'heroku.com,50.19.85.156' (RSA) to the list of known hosts.
04-Feb-2014 22:50:55 Initializing repository, done.
04-Feb-2014 22:50:57
04-Feb-2014 22:50:58 -----> Fetching custom git buildpack... done
04-Feb-2014 22:50:58
04-Feb-2014 22:50:58 !     Push rejected, no Cedar-supported app detected
04-Feb-2014 22:50:58
04-Feb-2014 22:50:58 To [email protected]:app.git
04-Feb-2014 22:50:58 ! [remote rejected] deploy -> master (pre-receive hook declined)
04-Feb-2014 22:50:58 error: failed to push some refs to '[email protected]:app.git'

This was after following this guide
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Luke Daley
Administrator
Good work.

What we do is use the inline build pack, then we can put the how to build scripts in the source tree. This gives complete control over how things work.

You can see our buildpack here: https://github.com/ratpack/ratpack/tree/master/bin
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
You mind giving me a quick walk through in how this is done. Forgive me I'm just learning how to use Heroku as well.

I did this :

heroku config:add BUILDPACK_URL=http://github.com/kr/heroku-buildpack-inline.git --app appname

on my machine to configure my heroku app to use the inline buildpack. After which, I checkout a deploy branch in my local repo, and committed the 3 files from your build back namely: bin/release, bin/compile and bin/detect to the deploy branch then I push to heroku,

The following is my output:

05-Feb-2014 13:10:46 Switched to a new branch 'deploy'
05-Feb-2014 13:10:46 [deploy f29a828] Heroku deployment artifacts.
05-Feb-2014 13:10:46 3 files changed, 68 insertions(+)
05-Feb-2014 13:10:46 create mode 100644 bin/compile
05-Feb-2014 13:10:46 create mode 100644 bin/detect
05-Feb-2014 13:10:46 create mode 100644 bin/release
05-Feb-2014 13:10:46 Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
05-Feb-2014 13:10:48 Initializing repository, done.
05-Feb-2014 13:10:50
05-Feb-2014 13:10:51 -----> Fetching custom git buildpack... done
05-Feb-2014 13:10:51
05-Feb-2014 13:10:51 !     Push rejected, no Cedar-supported app detected
05-Feb-2014 13:10:51
05-Feb-2014 13:10:51 To [email protected]:appname.git
05-Feb-2014 13:10:51 ! [remote rejected] deploy -> master (pre-receive hook declined)
05-Feb-2014 13:10:51 error: failed to push some refs to '[email protected]:appname.git'
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Marcin Erdmann
The problem is that there are multiple things that can go wrong here. And there are multiple ways of fixing them. I will create a ratpack specific buildpack that will be easy to use and get back to you when it's ready.


On Wed, Feb 5, 2014 at 6:15 PM, windlessuser [via Ratpack Forum] <[hidden email]> wrote:
You mind giving me a quick walk through in how this is done. Forgive me I'm just learning how to use Heroku as well.

I did this :

heroku config:add BUILDPACK_URL=http://github.com/kr/heroku-buildpack-inline.git --app appname

on my machine to configure my heroku app to use the inline buildpack. After which, I checkout a deploy branch in my local repo, and committed the 3 files from your build back namely: bin/release, bin/compile and bin/detect to the deploy branch then I push to heroku,

The following is my output:

05-Feb-2014 13:10:46 Switched to a new branch 'deploy'
05-Feb-2014 13:10:46 [deploy f29a828] Heroku deployment artifacts.
05-Feb-2014 13:10:46 3 files changed, 68 insertions(+)
05-Feb-2014 13:10:46 create mode 100644 bin/compile
05-Feb-2014 13:10:46 create mode 100644 bin/detect
05-Feb-2014 13:10:46 create mode 100644 bin/release
05-Feb-2014 13:10:46 Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
05-Feb-2014 13:10:48 Initializing repository, done.
05-Feb-2014 13:10:50
05-Feb-2014 13:10:51 -----> Fetching custom git buildpack... done
05-Feb-2014 13:10:51
05-Feb-2014 13:10:51 !     Push rejected, no Cedar-supported app detected
05-Feb-2014 13:10:51
05-Feb-2014 13:10:51 To [hidden email]:appname.git
05-Feb-2014 13:10:51 ! [remote rejected] deploy -> master (pre-receive hook declined)
05-Feb-2014 13:10:51 error: failed to push some refs to '[hidden email]:appname.git'


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/Deploying-a-ratpack-app-with-Atlassian-Bamboo-tp357p366.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
Thank you! It would be much appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
Getting closer still. I used this buildpack: https://github.com/marcoVermeulen/heroku-buildpack-ratpack

06-Feb-2014 10:38:28 Switched to a new branch 'deploy'
06-Feb-2014 10:38:28 [deploy 6642f2f] Heroku deployment artifacts.
06-Feb-2014 10:38:28 3 files changed, 68 insertions(+)
06-Feb-2014 10:38:28 create mode 100644 bin/compile
06-Feb-2014 10:38:28 create mode 100644 bin/detect
06-Feb-2014 10:38:28 create mode 100644 bin/release
06-Feb-2014 10:38:28 Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
06-Feb-2014 10:38:30 Initializing repository, done.
06-Feb-2014 10:38:33
06-Feb-2014 10:38:34 -----> Fetching custom git buildpack... done
06-Feb-2014 10:38:34 -----> Ratpack app detected
06-Feb-2014 10:38:34 -----> .jdk7 folder not found! -----> Installing openjdk1.7.0_21 build (to .jdk7).....  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
06-Feb-2014 10:38:34                                 Dload  Upload   Total   Spent    Left  Speed
06-Feb-2014 10:38:34
06-Feb-2014 10:38:35  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
06-Feb-2014 10:38:36  6 54.9M    6 3620k    0     0  5552k      0  0:00:10 --:--:--  0:00:10 5811k
06-Feb-2014 10:38:37 33 54.9M   33 18.5M    0     0  11.2M      0  0:00:04  0:00:01  0:00:03 11.4M
06-Feb-2014 10:38:38 57 54.9M   57 31.7M    0     0  12.0M      0  0:00:04  0:00:02  0:00:02 12.1M
06-Feb-2014 10:38:38 86 54.9M   86 47.2M    0     0  12.9M      0  0:00:04  0:00:03  0:00:01 13.0M
06-Feb-2014 10:38:38 100 54.9M  100 54.9M    0     0  13.6M      0  0:00:04  0:00:04 --:--:-- 13.7M
06-Feb-2014 10:38:38 Done!
06-Feb-2014 10:38:38
06-Feb-2014 10:38:38 -----> Building project with Gradle wrapper:
06-Feb-2014 10:38:38       ./gradlew clean installApp
06-Feb-2014 10:38:38 /tmp/buildpack_43bd3080-929c-4219-a103-a9e363e5e7bb/bin/compile: line 54: ./gradlew: Permission denied
06-Feb-2014 10:38:38
06-Feb-2014 10:38:38 !     Push rejected, failed to compile Ratpack app
06-Feb-2014 10:38:38
06-Feb-2014 10:38:38 To [email protected]:appname.git
06-Feb-2014 10:38:38 ! [remote rejected] deploy -> master (pre-receive hook declined)
06-Feb-2014 10:38:38 error: failed to push some refs to '[email protected]:appname.git'
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Marcin Erdmann
I added a gradle ratpack-heroku plugin. It's available in the latest snapshot (you might need to run './gradlew tasks --refresh-dependencies' to get it).

Steps to use it:

1. In your build.gradle add:
    apply plugin: 'ratpack-heroku'

2. Make sure that your project has a fixed name, in settings.gradle:
    rootProject.name = 'example'

3. Generate buildpack files:
    ./gradlew generateBuildpackFiles
Add and commit all four generated files.

4. Create a heroku app that will use the regular inline buildpack
    heroku create app-name --buildpack https://github.com/kr/heroku-buildpack-inline.git

5. Push to heroku.

Let me know if that doesn't work for you. I tested it on a simple example app just now.


On Thu, Feb 6, 2014 at 3:40 PM, windlessuser [via Ratpack Forum] <[hidden email]> wrote:
Getting closer still. I used this buildpack: https://github.com/marcoVermeulen/heroku-buildpack-ratpack

06-Feb-2014 10:38:28 Switched to a new branch 'deploy'
06-Feb-2014 10:38:28 [deploy 6642f2f] Heroku deployment artifacts.
06-Feb-2014 10:38:28 3 files changed, 68 insertions(+)
06-Feb-2014 10:38:28 create mode 100644 bin/compile
06-Feb-2014 10:38:28 create mode 100644 bin/detect
06-Feb-2014 10:38:28 create mode 100644 bin/release
06-Feb-2014 10:38:28 Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
06-Feb-2014 10:38:30 Initializing repository, done.
06-Feb-2014 10:38:33
06-Feb-2014 10:38:34 -----> Fetching custom git buildpack... done
06-Feb-2014 10:38:34 -----> Ratpack app detected
06-Feb-2014 10:38:34 -----> .jdk7 folder not found! -----> Installing openjdk1.7.0_21 build (to .jdk7).....  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
06-Feb-2014 10:38:34                                 Dload  Upload   Total   Spent    Left  Speed
06-Feb-2014 10:38:34
06-Feb-2014 10:38:35  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
06-Feb-2014 10:38:36  6 54.9M    6 3620k    0     0  5552k      0  0:00:10 --:--:--  0:00:10 5811k
06-Feb-2014 10:38:37 33 54.9M   33 18.5M    0     0  11.2M      0  0:00:04  0:00:01  0:00:03 11.4M
06-Feb-2014 10:38:38 57 54.9M   57 31.7M    0     0  12.0M      0  0:00:04  0:00:02  0:00:02 12.1M
06-Feb-2014 10:38:38 86 54.9M   86 47.2M    0     0  12.9M      0  0:00:04  0:00:03  0:00:01 13.0M
06-Feb-2014 10:38:38 100 54.9M  100 54.9M    0     0  13.6M      0  0:00:04  0:00:04 --:--:-- 13.7M
06-Feb-2014 10:38:38 Done!
06-Feb-2014 10:38:38
06-Feb-2014 10:38:38 -----> Building project with Gradle wrapper:
06-Feb-2014 10:38:38       ./gradlew clean installApp
06-Feb-2014 10:38:38 /tmp/buildpack_43bd3080-929c-4219-a103-a9e363e5e7bb/bin/compile: line 54: ./gradlew: Permission denied
06-Feb-2014 10:38:38
06-Feb-2014 10:38:38 !     Push rejected, failed to compile Ratpack app
06-Feb-2014 10:38:38
06-Feb-2014 10:38:38 To [hidden email]:smarttaxi.git
06-Feb-2014 10:38:38 ! [remote rejected] deploy -> master (pre-receive hook declined)
06-Feb-2014 10:38:38 error: failed to push some refs to '[hidden email]:smarttaxi.git'


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/Deploying-a-ratpack-app-with-Atlassian-Bamboo-tp357p369.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
In reply to this post by Marcin Erdmann
I got ratpack from lazybones... is there a way to update my ratpack installation?
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Luke Daley
Administrator
You just need to bump the ratpack number in your build.gradle.
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Marcin Erdmann
You'll need to change the buildscript block to:

classpath 'io.ratpack:ratpack-gradle:0.9.2-SNAPSHOT'

And you will be on the latest snapshot.



On Thu, Feb 6, 2014 at 9:37 PM, Luke Daley [via Ratpack Forum] <[hidden email]> wrote:
You just need to bump the ratpack number in your build.gradle.



If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/Deploying-a-ratpack-app-with-Atlassian-Bamboo-tp357p373.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

windlessuser
In reply to this post by Marcin Erdmann
Man you are a life saver I finally got everything to work! I can tell my team!!! Thanks to you all, I'm gonna see if I can contribute to this project myself!
Reply | Threaded
Open this post in threaded view
|

Re: Deploying a ratpack app with Atlassian Bamboo

Marcin Erdmann

No worries man. Glad I could help and hopefully it will be easier for anyone who wants to deploy a Ratpack app to heroku in the future, myself included.

On Feb 6, 2014 10:20 PM, "windlessuser [via Ratpack Forum]" <[hidden email]> wrote:
Man you are a life saver I finally got everything to work! I can tell my team!!! Thanks to you all, I'm gonna see if I can contribute to this project myself!


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/Deploying-a-ratpack-app-with-Atlassian-Bamboo-tp357p376.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML