![]() Always externalize sensitive information! Securely set environment variable in Travis CI We are using environment variables ( $CF_API, $CF_USER, $CF_PASS, $CF_ORG and $CF_ENV) that we still need to define since we don’t want our credentials to be available in cleartext in a file that is available on GitHub. If you don’t have an account yet, or don’t know how to get up and running with Jekyll with Bluemix then definitely check out my previous post about running Jekyll on Bluemix. Since Bluemix is based on Cloud Foundry we can use the Cloud Foundry deployment provider. Travis CI works with the notion of deploy providers to deploy to different platform. ``` yaml deploy : provider : cloudfoundry edge : true api : $CF_API username : $CF_USER password : $CF_PASS organization : $CF_ORG space : $CF_ENV Travis will build from every push to any branch of your repo if leave it out. This will enable TravisCI start whenever a commit is pushed to Git.įirst let’s define a Gemfile in the project root folder to define the dependency that is needed to execute Jekyll.īranches : only : - master `` This will make sure Travis is only activated when a commit is pushed to the master branch. In my case this is the repository for this site, the repository is called drissamri/. Next head over to your profile so you can select which repository you want to enable in TravisCI. Head over to Travis CI and Sign up with you GitHub credentials. Automating this process will leave it less error prone and give me more time to actually write content! Sign up for Travis CI Let’s do this!ĭoing this will mean I can rest assured that Jekyll is able to build my site, that all the links in my pages are functional (html-proofer) and that the latest version of my code is always pushed to the Bluemix server. I prefer Bluemix because it offers a lot of services and also has a pretty decent free tier. Since Bluemix is based on Cloud Foundry this guide will also work for any other provider that uses Cloud Foundry like Pivotal WebServices, anynines and so on. This build will do a couple of things, first it will generate my Jekyll static site, then run html-proofer to see if any of the links on the website are broken and finally deploy the site to Bluemix. ![]() What I want to accomplish is that each commit on my Git master branch triggers a build in Travis CI. Luckily for me, I’m using a public repository for my website so I’m able to try out it out without paying a dime. ![]() If you have used Jenkins before, you can compare it with that, only you don’t have to install anything since it’s an online service so you can just sign up with your GitHub account. If you are currently using a public GitHub repository then you can also use Travis CI for free! If you don’t know Travis CI, it’s a hosted Continuous Integration platform that makes it easy to have automated builds for your applications. This will only take a few minutes to setup. ![]() What I want to achieve is that every Git push will result in an automated deployment of my website on Bluemix. A simple site like this website can benefit from it, that is why I will show you how easy it is to set it up for a GitHub project with Travis CI. You’ve been reading much about Continuous Integration and Continuous Deployment and think it only applies to big projects? Think again.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |