GithubHelp home page GithubHelp logo

phrawzty / consul-rpm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tomhillable/consul-rpm

0.0 1.0 0.0 85 KB

Spec file and sources needed to package consul

License: Mozilla Public License 2.0

Shell 100.00%

consul-rpm's Introduction

RPM Spec for Consul

Tries to follow the packaging guidelines from Fedora.

  • Binary: /usr/bin/consul
  • Config: /etc/consul.d/
  • Shared state: /var/lib/consul/
  • Sysconfig: /etc/sysconfig/consul
  • WebUI: /usr/share/consul/

Using

Create the RPMs using one of the techniques outlined in the Build section below.

Pre-built packages

Pre-built packages are maintained via the Fedora Copr system. For more information, please see the duritong/consul repository on Copr.

Build

There are a number of ways to build the consul and consul-ui RPMs:

  • Manual
  • Vagrant
  • Docker

Each method ultimately does the same thing - pick the one that is most comfortable for you.

Version

The version number is hardcoded into the SPEC, however should you so choose, it can be set explicitly by passing an argument to rpmbuild directly:

$ rpmbuild --define "_version 0.6.3"

Manual

Build the RPM as a non-root user from your home directory:

  • Check out this repo. Seriously - check it out. Nice.

    git clone <this_repo_url>
    
  • Install rpmdevtools and mock.

    sudo yum install rpmdevtools mock
    
  • Set up your rpmbuild directory tree.

    rpmdev-setuptree
    
  • Link the spec file and sources.

    ln -s $HOME/consul-rpm/SPECS/consul.spec $HOME/rpmbuild/SPECS/
    find $HOME/consul-rpm/SOURCES -type f -exec ln -s {} $HOME/rpmbuild/SOURCES/ \;
    
  • Download remote source files.

    spectool -g -R rpmbuild/SPECS/consul.spec
    
  • Spectool may fail if your distribution has an older version of cURL (CentOS 6.x, for example) - if so, use Wget instead.

    VER=`grep Version rpmbuild/SPECS/consul.spec | awk '{print $2}'`
    URL='https://dl.bintray.com/mitchellh/consul'
    wget $URL/consul_${VER}_linux_amd64.zip -O $HOME/rpmbuild/SOURCES/consul_${VER}_linux_amd64.zip
    wget $URL/consul_${VER}_web_ui.zip -O $HOME/rpmbuild/SOURCES/consul_${VER}_web_ui.zip
    
  • Build the RPM.

    rpmbuild -ba rpmbuild/SPECS/consul.spec
    

Vagrant

If you have Vagrant installed:

  • Check out this repo.

    git clone https://github.com/tomhillable/consul-rpm
    
  • Edit Vagrantfile to point to your favourite box (Bento CentOS7 in this example).

    config.vm.box = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box"
    
  • Vagrant up! The RPMs will be copied to working directory after provisioning.

    vagrant up
    

Docker

If you prefer building it with Docker:

  • Build the Docker image. Note that you must amend the Dockerfile header if you want a specific OS build (default is centos7).

    docker build -t consul:build .
    
  • Run the build.

    docker run -v $HOME/consul-rpms:/RPMS consul:build
    
  • Retrieve the built RPMs from $HOME/consul-rpms.

Result

Three RPMs:

  • consul server
  • consul web UI
  • consul-template

Run

  • Install the RPM.
  • Put config files in /etc/consul.d/.
  • Change command line arguments to consul in /etc/sysconfig/consul.
    • Add -bootstrap only if this is the first server and instance.
  • Start the service and tail the logs systemctl start consul.service and journalctl -f.
    • To enable at reboot systemctl enable consul.service.
  • Consul may complain about the GOMAXPROCS setting. This is safe to ignore; however, the warning can be supressed by uncommenting the appropriate line in /etc/sysconfig/consul.

Config

Config files are loaded in lexicographical order from the config-dir. Some sample configs are provided.

More info

See the consul.io website.

consul-rpm's People

Contributors

arodd avatar dky avatar duritong avatar grossws avatar jasperla avatar millnert avatar nathanhruby avatar pdilung avatar phrawzty avatar rumenvasilev avatar temikus avatar tomhillable avatar tomlanyon avatar tootedom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.