Java IoT Authors: Liz McMillan, Pat Romanski, Elizabeth White, Hollis Tibbetts, Sematext Blog

Related Topics: Java IoT, Open Source Cloud, IoT User Interface, Apache

Java IoT: Blog Post

How to Deploy a node.js App from GitHub to Heroku

How to set up Continuous Integration and Continuous Deployment for a node.js Application from GitHub to Heroku

In this blog post we're gonna deploy a Node.js application from a GitHub repository to Heroku using the Codeship.

We've set up a simple Node.js application called codefish which contains some Jasmine specs. We'll use screenshots of this application in this blog post. If you don't have an own project to set up but you want to follow along on your computer, just fork the repository.

codefish-node on GitHub

Together, we're gonna deploy this application to Heroku using the Codeship.

The Codeship Landing Page

First, sign in to the Codeship with GitHub. The Codeship needs access to your GitHub repositories to be able to set them up. Let's allow access.

GitHub Access

We're back at the Codeship. Now let's create your first project.

Let's set up our first project on the Codeship

The first step of your project setup is to select GitHub as your repository provider.

Select your repository provider

In the list of your GitHub repositories

Search for your repository in the list

search for the repository you want to set up and select it. In my case I search for "codefish".

Find your repository in the filtered list

Now your repository is connected and you can set up your test commands:

Set up your test commands

Codefish is a Node.js application. So I choose "Node.js" as my framework. This prepopulates the setup commands and the test commands for you.

Select Node.js as your technology

The Codeship suggests Node.js 0.10.18, but you can use whatever Node version you like. If you're unsure about the Node version of your project, type node -v in the Terminal.

Type ruby -v and find out your Ruby version

Just copy your Node version into the nvm install and nvm use statements.

If you want to run Jasmine specs, you need to install jasmine-node globally additionally to your node modules. In this case just add npm install -g jasmine-node after npm install.

You don't need npm test for your Jasmine specs, so you can comment it by adding a hash key before the command. Instead, add jasmine-node spec to the test commands to run your Jasmine specs.

Comment the test command <code>npm test</code> and add <code>jasmine-node spec</code>

Now let's finish your setup and go to the dashboard.

Finish your setup. You are on the Dashboard now

You can trigger a build for your application by pushing to your repository. Let's add the Codeship status image to the README file. I use markdown syntax to insert the image.

Copy the code for the Codeship status badge to your README file

Now commit and push this change.

Commit and push your change

This triggered a new build on the Codeship.

A new build got triggered on the Codeship

You can access the build details by clicking the arrow on the right. Here you can follow the running build.

Click on the arrow to the right to access the build details

And a few seconds later your build succeeded! Great!

Look at all the commands that are running

You see all the commands that were run. After a few initial preparation commands the Codeship ran the commands that you specified a few moments ago.

You can inspect the output of a single command by clicking on it. For the codefishapplication, we can see that two Jasmine specs were run.

Look at the log of a single command by clicking on it

You've already pushed to your repository, watched your build log and got a green build. So you can finish the assistant at the top.

Finish the setup wizard by clicking on the click to finish button

Now let's deploy your application to Heroku. Go to your project settings by clicking on the settings icon in the projects dropdown.

Go to your project settings by clicking on the settings icon in the projects dropdown

You are on the Testing Setup screen now

Then navigate to the "Deployment" section.

You are on the Deployment Setup screen now

As we want to deploy to Heroku we click on the "Heroku" button.

Click on the Heroku button

Now you are asked to enter the name of your Heroku application and your API key. If you haven't already, now is the time to go to Heroku and create an application.

You are on the Heroku page now

I named my application "codefish-app", but please choose whatever name you like

Create your app and name it codefish-app

and create your app.

You successfully created your Heroku App

Back at your deployment configuration on the Codeship enter the application name.

Back on the Codeship we enter the application name codefish-app

To retrieve your Heroku API key, follow the link to your Heroku account and click "Show API key".

Click on the link to get your Heroku API key

Copy it and insert it into your deployment configuration at the Codeship.

Copy and paste the Heroku API key to the Codeship

Now save your deployment by clicking on the green checkmark on the right.

Save your deployment configuration by clicking on the green checkmark

From now on the Codeship will deploy your application to Heroku everytime you push to your GitHub repository. Let's push a change and see if it gets deployed. Change something in your application first,

Add a new paragraph you can then commit and push

then commit and push the change.

Commit and push the change

And immediately another build will start running on the Codeship. Let's go back to your project overview.

Go back to the project overview to see a new running build

After the commands we already know from your first build, your application also gets deployed to Heroku now.

After some initial commands were run your application gets deployed

And about 2 minutes later your application is online.

After about 2 minutes your application is online

When you open the URL of your Heroku app now, your deployed application appears. You can find mine on codefish-app.herokuapp.com.

Have a look at the app you just deployed

If you need help with setting up your own application, please use the support link in the top-right corner or please tweet us @codeship!

If you need help please click the support link in the top-right corner or tweet us @codeship

Set up Continuous Integration and Deployment for your node.js projects. The Codeship supports GitHub and BitBucket projects and about any techstack you can imagine.

Go ahead and try the Codeship for free! Set up Continuous Integration and Deployment for your GitHub and BitBucket projects in only 3 minutes.

More Stories By Manuel Weiss

I am the cofounder of Codeship – a hosted Continuous Integration and Deployment platform for web applications. On the Codeship blog we love to write about Software Testing, Continuos Integration and Deployment. Also check out our weekly screencast series 'Testing Tuesday'!

@ThingsExpo Stories
SYS-CON Events announced today that Enzu will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their online busine...
November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Penta Security is a leading vendor for data security solutions, including its encryption solution, D’Amo. By using FPE technology, D’Amo allows for the implementation of encryption technology to sensitive data fields without modification to schema in the database environment. With businesses having their data become increasingly more complicated in their mission-critical applications (such as ERP, CRM, HRM), continued ...
In the next five to ten years, millions, if not billions of things will become smarter. This smartness goes beyond connected things in our homes like the fridge, thermostat and fancy lighting, and into heavily regulated industries including aerospace, pharmaceutical/medical devices and energy. “Smartness” will embed itself within individual products that are part of our daily lives. We will engage with smart products - learning from them, informing them, and communicating with them. Smart produc...
OnProcess Technology has announced it will be a featured speaker at @ThingsExpo, taking place November 1 - 3, 2016, in Santa Clara, California. Dan Gettens, OnProcess’ Chief Analytics Officer, will discuss how Internet of Things (IoT) data can be leveraged to predict product failures, improve uptime and slash costly inventory stock. @ThingsExpo is an annual gathering of IoT and cloud developers, practitioners and thought-leaders who exchange ideas and insights on topics ranging from Big Data in...
SYS-CON Events announced today that SoftNet Solutions will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. SoftNet Solutions specializes in Enterprise Solutions for Hadoop and Big Data. It offers customers the most open, robust, and value-conscious portfolio of solutions, services, and tools for the shortest route to success with Big Data. The unique differentiator is the ability to architect and ...
SYS-CON Events announced today that Cloudbric, a leading website security provider, will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Cloudbric is an elite full service website protection solution specifically designed for IT novices, entrepreneurs, and small and medium businesses. First launched in 2015, Cloudbric is based on the enterprise level Web Application Firewall by Penta Security Sys...
SYS-CON Events announced today that Transparent Cloud Computing (T-Cloud) Consortium will exhibit at the 19th International Cloud Expo®, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. The Transparent Cloud Computing Consortium (T-Cloud Consortium) will conduct research activities into changes in the computing model as a result of collaboration between "device" and "cloud" and the creation of new value and markets through organic data proces...
SYS-CON Events announced today that Roundee / LinearHub will exhibit at the WebRTC Summit at @ThingsExpo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. LinearHub provides Roundee Service, a smart platform for enterprise video conferencing with enhanced features such as automatic recording and transcription service. Slack users can integrate Roundee to their team via Slack’s App Directory, and '/roundee' command lets your video conference ...
Successful digital transformation requires new organizational competencies and capabilities. Research tells us that the biggest impediment to successful transformation is human; consequently, the biggest enabler is a properly skilled and empowered workforce. In the digital age, new individual and collective competencies are required. In his session at 19th Cloud Expo, Bob Newhouse, CEO and founder of Agilitiv, will draw together recent research and lessons learned from emerging and established ...
SYS-CON Events announced today that Coalfire will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Coalfire is the trusted leader in cybersecurity risk management and compliance services. Coalfire integrates advisory and technical assessments and recommendations to the corporate directors, executives, boards, and IT organizations for global brands and organizations in the technology, cloud, health...
As ridesharing competitors and enhanced services increase, notable changes are occurring in the transportation model. Despite the cost-effective means and flexibility of ridesharing, both drivers and users will need to be aware of the connected environment and how it will impact the ridesharing experience. In his session at @ThingsExpo, Timothy Evavold, Executive Director Automotive at Covisint, will discuss key challenges and solutions to powering a ride sharing and/or multimodal model in the a...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, will discuss how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team a...
A completely new computing platform is on the horizon. They’re called Microservers by some, ARM Servers by others, and sometimes even ARM-based Servers. No matter what you call them, Microservers will have a huge impact on the data center and on server computing in general. Although few people are familiar with Microservers today, their impact will be felt very soon. This is a new category of computing platform that is available today and is predicted to have triple-digit growth rates for some ...
DevOps is being widely accepted (if not fully adopted) as essential in enterprise IT. But as Enterprise DevOps gains maturity, expands scope, and increases velocity, the need for data-driven decisions across teams becomes more acute. DevOps teams in any modern business must wrangle the ‘digital exhaust’ from the delivery toolchain, "pervasive" and "cognitive" computing, APIs and services, mobile devices and applications, the Internet of Things, and now even blockchain. In this power panel at @...
The Internet of Things (IoT), in all its myriad manifestations, has great potential. Much of that potential comes from the evolving data management and analytic (DMA) technologies and processes that allow us to gain insight from all of the IoT data that can be generated and gathered. This potential may never be met as those data sets are tied to specific industry verticals and single markets, with no clear way to use IoT data and sensor analytics to fulfill the hype being given the IoT today.
SYS-CON Events announced today that Numerex Corp, a leading provider of managed enterprise solutions enabling the Internet of Things (IoT), will exhibit at the 19th International Cloud Expo | @ThingsExpo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Numerex Corp. (NASDAQ:NMRX) is a leading provider of managed enterprise solutions enabling the Internet of Things (IoT). The Company's solutions produce new revenue streams or create operating...
SYS-CON Events announced today that MathFreeOn will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. MathFreeOn is Software as a Service (SaaS) used in Engineering and Math education. Write scripts and solve math problems online. MathFreeOn provides online courses for beginners or amateurs who have difficulties in writing scripts. In accordance with various mathematical topics, there are more tha...
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
@ThingsExpo has been named the Top 5 Most Influential Internet of Things Brand by Onalytica in the ‘The Internet of Things Landscape 2015: Top 100 Individuals and Brands.' Onalytica analyzed Twitter conversations around the #IoT debate to uncover the most influential brands and individuals driving the conversation. Onalytica captured data from 56,224 users. The PageRank based methodology they use to extract influencers on a particular topic (tweets mentioning #InternetofThings or #IoT in this ...
The Internet of Things will challenge the status quo of how IT and development organizations operate. Or will it? Certainly the fog layer of IoT requires special insights about data ontology, security and transactional integrity. But the developmental challenges are the same: People, Process and Platform and how we integrate our thinking to solve complicated problems. In his session at 19th Cloud Expo, Craig Sproule, CEO of Metavine, will demonstrate how to move beyond today's coding paradigm ...