My goal is to to set up a horizontally scalable app on Heroku using the Play! framework. The web worker will receive inbound requests from users and will offload the work and run the jobs asynchronously through RabbitMQ to a background worker.
The web worker will be very light weight, however my background workers will be under a lot of load and so will need to scale.
The background workers will just be a Java class which is called from the Procfile as a command. The classes will then listen for messages published by RabbitMQ.
The challenge I'm facing is that I'm quite new to both Heroku and additionally the Play! framework.
My question is it possible/wise to build a scalable application on Heroku in this manner?
And additionally am I handling the background workers in the right approach for use within Play! framework?
Thank you in advance.
The challenge I'm facing is that I'm quite new to both Heroku and additionally the Play! framework.
I can explain you how you can run your project using Play framework on Heroku.
First you should install Heroku toolbelt & Git.
Then open your terminal and configure the git according to your account:
git config --global user.name "yourName"
git config --global user.email "yourgithub#email.com"
git config --global push.default matching
git config --alias.co checkout
Then go to your project folder and type git init. This is going to initialize an empty Git repository. When you commit your code, it's going to be saved in this repository, then you can push it to Github.
Once you initialize Git repository, type git statusto see untracked files. Now you should add files to include in what will be committed: git add .. Dot means "all". Then you are allowed to commit them by typing: git commit -a -m "message". Whenever you make some changes in your code, or add new files, you just need to type git status, then commit them like the way l've just explained.
After you successfully commit your code to Git repository, all you need to do is to create a repository on Github and copy the lines that are for "... or push an existing repository from the command line"
Note: You might need to set your own SSH for both Github and Heroku.
Once you upload your project to the Github, you can now set Heroku for your project. What you need to do is now set Heroku credentials. Then goto your project folder and type heroku create. Once you create heroku for your project, you can type heroku opento see your own heroku page for your project. git push heroku master allows you to push your project that you added to the Git repository to the Heroku. If everything goes well, you can refresh your browser and see that your project works on Heroku.
Related
I was setting up drools workbench in the organization via docker and kubernetes. I want to sync repositories from bitbucket whenever a new pod comes up in docker. Is there a way to sync projects on pod startup in drools workbench.
I tried adding .git files of the project to the .niogit folder but didn't work.
I also tried to create a script to push to the local git repository but this requires repository to be initialized before.
I was thinking of creating a script to sync project code using webhooks and syncing .niogit folder everytime there was some change to s3 or some other storage and fetch the code during initialization.
Is there a easy way to setup the repo. and maintain a sync between the internal and github/bitbucket repo.
Thanks in advance
I am sure this must have been solved before, but I could not get a concrete example.
I have a web app which is taking input from user for some config mgmt and creating an XML. The XML is supposed to be checked into a git repo.
Being new to Git a little clueless, all examples point that we need to have a local repository cloned on disk before doing a git add and finally a git commit and git push.
My question is can't we avoid cloning locally and do a git commit and git push programmatically (java) for that given file [myrepo/config/my-config.xml]
Any example really appreciated.
No, you can not do commit and push without local repository.
I'm really nooby in 'Continuous integration'. And have a question about it.
Is it possible to create jar, ear or war file and deploy it on jboss every time I merge my develop branch (release) with master branch. I user gradle for build my project. I prefer something without user interface. My server runs on ubuntu server.
You should use a build server (like Jenkins) that could be configured to poll your git repository and run the build upon commit and on a successful build it would deploy (by a script or some plugin) the build product (jar/war) onto your JBoss server.
I have a Java web application that I have managed to successfully deploy and get running on Heroku using the 'git push heroku master' method, but I would like to automate deployment and have a full CI setup. I've had a go at using Atlassian Bamboo with the Heroku plugin but it's really only suitable for standalone .war files - I need to be able to specify additional config via the Procfile definition in my project.
What have other people used for CI/CD of Java web applications to Heroku?
Jenkins has a good Heroku Plugin, that allow you to deploy WARs and interact with Heroku in many ways, including setting variables, scaling your dynos and running one-off processes:
https://github.com/heroku/heroku-jenkins-plugin/blob/master/README.md
To change the Procfile on Heroku, you need to commit and push the new file. You can do that as a step on your CI build. Jenkins can run scripts as part of your build, where you could easily push a new Procfile if that is needed.
I have a local git server (centOS) where everyone pushes their work to that repository. Jenkins manages to build whatever in that repository is, overnight. Lately I've got a Git Enterprise account. I've been wondering if there's any way to force Jenkins to 1) Only pulls the code from the local server and 2) Whenever a build was successful, sends the code to git enterprise remote repository.
I'm using Jenkins v. 1.458
well, one option would be to just create a script that does this from bash...but...
You can just add two git repositories under the "source code management" section after installing the Multiple SCMs plugin, and then specify that you want to build REPOLOCALNAME/branch, and then at the end under 'Git publisher' specify you want to merge and push to the remote branch. (ie. BranchToPush=branchname and TargetRemoteName= REMOTEREPONAME)
*Remember, the names are specified under advanced options of the repository when you add it under the SCM section.
*I haven't tested this, there is a chance that it might let you only pull and push, from and to the same repository.
You could set up the push to Github as the last build step that is only run after everything else has succeeded and use the normal mechanisms for retrieving the code from the local git repository. There is no plugin that has this functionality at the moment.