In this getting starting guide you will learn how elastic-package can help you quickly start a full Elastic Stack.
Elastic-package is an open source tool that will help you shorten your development time by providing pre-built commands. For example it will help you lint, format, test, build, and promote your packages.
Each and every developer that wants to contribute by creating their own integrations should use elastic-package. It will provide a ready-to-code environment.
Getting started with elastic-package
As a developer you can use elastic-package in two ways, the first one is through binary usage and the second one is by pulling elastic-package github repository.
For binary usage, start by downloading the latest version.
Pull the archive that you need and unarchive it locally.
julienlind@MacBook-Pro Downloads % tar -xvf elastic-package_0.20.1_darwin_amd64.tar.gz
Then you can experiment with the elastic-package command line. First, try starting with the "help" command.
(Note:It might improve your developer experience if you put the tool in your PATH. Edit your ~/.bashrc file and specify your executable PATH: “PATH=$PATH:$PATH_TO_MY_EXEC”)
julienlind@MacBook-Pro Downloads % elastic-package help elastic-package - Command line tool for developing Elastic Integrations Usage: elastic-package [command] Available Commands: build Build the package check Check the package clean Clean used resources completion generate the autocompletion script for the specified shell create Create package resources export Export package assets format Format the package help Help about any command install Install the package lint Lint the package profiles Manage stack config profiles promote Promote packages publish Publish the package to the Package Registry service Manage the service stack stack Manage the Elastic stack status Show package status test Run test suite for the package uninstall Uninstall the package version Show application version Flags: -h, --help help for elastic-package -v, --verbose verbose mode Use "elastic-package [command] --help" for more information about a command.Read more
With the github repository:
julienlind@MacBook-Pro Downloads % git clone https://github.com/elastic/elastic-package.git Cloning into 'elastic-package'... remote: Enumerating objects: 5188, done. remote: Counting objects: 100% (1356/1356), done. remote: Compressing objects: 100% (449/449), done. remote: Total 5188 (delta 1078), reused 936 (delta 901), pack-reused 3832 Receiving objects: 100% (5188/5188), 13.41 MiB | 26.11 MiB/s, done. Resolving deltas: 100% (2952/2952), done. julienlind@MacBook-Pro Downloads % cd elastic-package julienlind@MacBook-Pro elastic-package % make build [...] julienlind@MacBook-Pro elastic-package % elastic-package helpRead more
"make build”" command will call "go get" which will result in creating a binary file in ~/go/bin .
Thus here we assume that in your ~/.bashrc file you have specified your Golang executable path such as follow:
Start a local elastic stack in a few minutes
Here, we assume that you do have Docker desktop up and running on your computer.
Once you do, simply use the “stack” command as in the example below: