Skip to content

Bash script for register/deregister service in Consul

License

Notifications You must be signed in to change notification settings

magna-z/consul-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

consule-service

Bash script for register/deregister service in Consul

Requirements

  • Bash
  • cURL

Installation

export BIN_PATH="/opt/bin"
mkdir --parents "$BIN_PATH"
curl --silent --show-error --location --output "$BIN_PATH/consul-service" "https://raw.githubusercontent.com/magna-z/consul-service/master/consul-service.sh"
chmod +x "$BIN_PATH/consul-service"

Usage

Register service in Consul:

CONSUL_URL=<consul-url> [CONSUL_TOKEN=<consul-token>] [CURL_MAX_TIME=5] consul-service register -e <environment> -n <name> -p <port> -t <tags>

Deregister service in Consul:

CONSUL_URL=<consul-url> [CONSUL_TOKEN=<consul-token>] [CURL_MAX_TIME=5] consul-service deregister -e <environment> -n <name>

About

Bash script for register/deregister service in Consul

Topics

Resources

License

Stars

Watchers

Forks

Languages