Kill Bill on Microsoft Azure

Kill Bill on Microsoft Azure

The open-source Kill Bill platform provides advanced subscription management as well as payment APIs. Businesses of any size, from the 2-person startup to public companies, rely on it for their e-commerce recurring billing and shopping cart payment needs. Lots of SaaS companies have similar offerings. Choosing the right partner from the get go is critical however, as migrations are error-prone and difficult. If you are a young startup, you probably want something simple, cheap and low-maintenance, which can adapt to your needs as you grow. Kill Bill combined with Microsoft Azure BizSpark for startups gives you just that, which probably explains the uptick of requests we’ve had recently regarding integration with Microsoft Azure. Thanks to our Docker images, this is quite easy – this tutorial will show you how to deploy Kill Bill integrated with Stripe in a few commands. Pre-requisites Create a Microsoft Azure account Write down your subscription id: log-in to https://portal.azure.com, click on the account dropdown, then “My permissions” Install the latest version of docker-machine VM setup Create the VM using docker-machine: docker-machine create -d azure \ --azure-ssh-user ops \ --azure-subscription-id AZURE_SUBSCRIPTION_ID \ --azure-open-port 8080 \ --azure-open-port 3000 \ azure You should see it running at https://portal.azure.com/#blade/HubsExtension/BrowseAllResourcesBlade. Write down the IP of the machine by running docker-machine ip azure Configure your shell for the rest of the tutorial: eval $(docker-machine env azure) Database setup For this tutorial, we will simply run a MySQL database in a Docker container on the same host: docker run -tid \ --name db \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=root \ -e MYSQL_DATABASE=killbill \ mariadb Modify the database to make sure it...

Deploying Kill Bill on Heroku

Similar to OpenShift, Heroku grants you a limited set of free resources each month (750 free dyno-hours per app) that you can leverage to run Kill Bill and the Kill Bill admin UI — Kaui, for free, in the cloud. This article will guide you through it. The same word of caution applies here as well regarding scalability: your free 750 dyno-hours will allow you to run one 1X dyno for an entire month free of charge, which is limited to 512MB of RAM. This is a bit small for the JVM (especially if you install Kill Bill plugins). While it is probably good enough for quick prototyping, we recommend you use a 2X dyno for your production environment. To create a Heroku account, go to https://id.heroku.com/signup/www-pricing-top. Even though Kill Bill will run free of charge, you need to verify you account by entering your credit card at https://heroku.com/verify. This is required as MySQL support is provided as an add-on only (and you need to verify your account to install add-ons, even free ones). The first step is to install the Herok Toolbelt by going to https://toolbelt.heroku.com/ and verify you can log-in by running heroku login To deploy WARs, you need to install the heroku-deploy CLI plugin: heroku plugins:install https://github.com/heroku/heroku-deploy Kill Bill deployment Grab the latest jar-with-dependencies.war artifact from Maven Central and create our kbdemo app, which will be running Tomcat and MySQL: heroku create kbdemo heroku deploy:war --war /path/to/killbill-server-*.war --app kbdemo heroku addons:remove heroku-postgresql:dev --app kbdemo --confirm kbdemo heroku addons:add cleardb --app kbdemo Kill Bill system properties are defined via the JAVA_OPTS environment variable. You can inspect it...

Deploying Kill Bill on OpenShift

Thanks to the entry-level offering of the Cloud Application Platform by Red Hat — OpenShift, you can run in the cloud Kill Bill and the Kill Bill admin UI — Kaui, for free. This article will guide you through it. Note that you only have free access to small containers (so called gears), which are less than ideal to run Kill Bill on: RAM is capped at 512MB, which is a bit small for the JVM (especially if you install Kill Bill plugins). This is reflected in the UI, which feels slow. While it is probably good enough for quick prototyping, we recommend you use at least a medium gear for your production environment. Once you created an account, the first step is to setup the OpenShift command line client: gem install rhc rhc setup Check the OpenShift documentation for more details. Let’s create our Demo app, which will be running Tomcat and MySQL: rhc create-app Demo jbossews-2.0 rhc cartridge add mysql-5.1 -a Demo Note that for simplicity, we created a non-scaled application. This means that Tomcat and MySQL will be installed on the same gear. For a real production environment, we would create a scaled application instead, which would make OpenShift install automatically MySQL on its own dedicated gear. The next step is to download Kill Bill. Grab the latest jar-with-dependencies.war artifact from Maven Central. Creating the Demo app should have cloned a demo.git repository. Go to that directory and copy the war file (you can also cleanup the src/ directory and pom.xml file): cp /path/to/killbill-server-*.war webapps/ROOT.war git rm -r src/ pom.xml Kill Bill system properties can be...