Skip to content

JonathanTron/hab-plans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hab-plans

This repository contains Habitat plans for the following app and libs:

Building packages

Install Docker and hab-cli.

In the root directory, run:

hab studio enter

Then to build a particular package go to its directory and run build:

cd beamium
build

Testing in a VM:

Install Vagrant and run in the root directory:

vagrant up

Once this is finished, you can connect to the VM via:

vagrant ssh

The VM will have the latest hab-cli, a hab user and group, as well as some of the softwares helpful to test the habitat packages.

Your packages will be available at /vagrant, in order to test one you have to start a supervisor first, the easiest to debug is to use screen/tmux/byobu or simply open two tabs in your terminal and connect to the vagrant VM.

In first tab/pane:

sudo hab svc run

In the second tab/pane:

hab pkg install /vagrant/prometheus-postfix_exporter/results/jonathantron-prometheus-post
fix_exporter-0.2.0-20200425093937-x86_64-linux.hart
hab svc load jonathantron/prometheus-postfix_exporter

If you want to test with a different config than the default, create a config file and apply it:

cat <<EOT >> postfix.toml
options=[
  "--web.telemetry-path '/metrics'",
  "--postfix.showq_path '/var/spool/postfix/public/showq'",
  "--postfix.logfile_path '/var/log/mail.log'"
]
EOT

cat postfix.toml | hab config apply prometheus-postfix_exporter.default $(date +%s)

Once done, you can either stop or completely destroy the VM:

# shutdown only
vagrant down

# remove it completely
vagrant destroy

Sending package to Habitat builder

Export your Personal access token for habitat builder and the origin:

export HAB_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export HAB_ORIGIN=jonathantron

Then enter the studio again, and build your package, or if already done upload it.

hab studio enter
cd beamium
# Build the package, you can skip of already build before
build
# get the last build infos in env
source results/last_build.env
# upload package to habitat builder
hab pkg upload results/$pkg_artifact

Releases

No releases published

Packages

No packages published

Languages