This document is a step-by-step guide to help you understand how our system works and the steps necessary to get a simple component pushed and ready for a successful integration using elastic.io platform.
In this guide
Upload your SSH Key
The first step would be to upload your SSH Key. We have a dedicated help page on how to create and upload your SSH Key in order to use it with our system.
Please note that failure to provide (upload) a unique SSH key would result in error "Permission denied" during the code Push (step 4).
Clone / prepare your component locally
If you have prepared your component locally by following instructions in how to build a component in Node.js or Java then you can skip this step. Otherwise, you can clone one of our template repositories to go through these steps couple of times to familiarise yourself. At the moment we are supporting only Node.js and Java so here are component templates in each language respectively:
For example in the case of Node.js you could start like this:
$ git clone https://github.com/elasticio/petstore-component-nodejs.git Cloning into 'petstore-component-nodejs'... remote: Counting objects: 130, done. remote: Compressing objects: 100% (9/9), done. remote: Total 130 (delta 3), reused 0 (delta 0), pack-reused 121 Receiving objects: 100% (130/130), 43.40 KiB | 0 bytes/s, done. Resolving deltas: 100% (60/60), done.
Checking the directory where you have cloned the component:
$ cd petstore-component-nodejs/ $ ls -ga total 64 drwxr-xr-x 10 staff 340 Mar 9 17:08 . drwxr-xr-x 12 staff 408 Mar 9 17:08 .. drwxr-xr-x 13 staff 442 Mar 9 17:08 .git -rw-r--r-- 1 staff 526 Mar 9 17:08 .gitignore -rw-r--r-- 1 staff 2703 Mar 9 17:08 README.md -rw-r--r-- 1 staff 2808 Mar 9 17:08 component.json drwxr-xr-x 5 staff 170 Mar 9 17:08 lib -rw-r--r-- 1 staff 11543 Mar 9 17:08 logo.png -rw-r--r-- 1 staff 621 Mar 9 17:08 package.json -rw-r--r-- 1 staff 1005 Mar 9 17:08 verifyCredentials.js
More information is available on our help page about how to develop component in Node.js.
Prepare the remote repository at elastic.io
At this stage, we want to know which repositories we have access to:
$ git remote -v originhttps://github.com/elasticio/petstore-component-nodejs.git (fetch) originhttps://github.com/elasticio/petstore-component-nodejs.git (push)
Now we need to add a new repository in our elastic.io interface which is described in more detail in components repositories page.
For a simplicity let us just take the same name for the repository creation
petstore-component-nodejs, and let's say we have created this particular repository in the development team called
dev-build. The platform would create a specific git repository like this:
email@example.com:petstore-component-nodejs.git. Then we add this repository to our local git configuration of local repository like this
$ git remote add elasticio firstname.lastname@example.org:petstore-component-nodejs.git $ git remote -v elasticio email@example.com:petstore-component-nodejs.git (fetch) elasticio firstname.lastname@example.org:petstore-component-nodejs.git (push) origin https://github.com/elasticio/petstore-component-nodejs.git (fetch) origin https://github.com/elasticio/petstore-component-nodejs.git (push)
Our repository is ready to receive the petstore-component-nodejs component.
Push your component into elastic.io repository
After performing all the task described above we are ready to push our code to the newly created repository on elastic.io. To do that we will type:
$ git push elasticio master
Before your push would go ahead the system will want to authenticate your SSH Key which we have created specifically for this. Please type yes and accept it to proceed.
Use the component
The newly added component can be found in the list of components when you start creating your integration flow normally.
If your component has only Action function then your component would show only when selecting an Action function while building the integration flow.
If your component has only Trigger function then your component would show only when selecting a Trigger component.