Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from matlockx/master
new consul version 0.7.0
- Loading branch information
Showing
10 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM gliderlabs/consul:0.7 | ||
ADD ./config /config/ | ||
EXPOSE 8300 8301 8301/udp 8302 8302/udp 8400 8500 8600 8600/udp | ||
ENV DNS_RESOLVES consul | ||
ENV DNS_PORT 8600 | ||
ENTRYPOINT ["/bin/consul", "agent", "-config-dir=/config"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
build: | ||
docker build -t gliderlabs/consul-agent:$(VERSION) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"client_addr": "0.0.0.0", | ||
"data_dir": "/data", | ||
"leave_on_terminate": true, | ||
"dns_config": { | ||
"allow_stale": true, | ||
"max_stale": "1s" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM gliderlabs/consul-agent:0.7 | ||
ADD ./config /config/ | ||
ENTRYPOINT ["/bin/consul", "agent", "-server", "-config-dir=/config"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
build: | ||
docker build -t gliderlabs/consul-server:$(VERSION) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ui": true, | ||
"dns_config": { | ||
"allow_stale": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM alpine:3.4 | ||
|
||
ENV CONSUL_VERSION 0.7.0 | ||
ENV CONSUL_SHA256 b350591af10d7d23514ebaa0565638539900cdb3aaa048f077217c4c46653dd8 | ||
|
||
RUN apk --no-cache add curl ca-certificates \ | ||
&& curl -sSL https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip -o /tmp/consul.zip \ | ||
&& echo "${CONSUL_SHA256} /tmp/consul.zip" > /tmp/consul.sha256 \ | ||
&& sha256sum -c /tmp/consul.sha256 \ | ||
&& cd /bin \ | ||
&& unzip /tmp/consul.zip \ | ||
&& chmod +x /bin/consul \ | ||
&& rm /tmp/consul.zip | ||
|
||
ENTRYPOINT ["/bin/consul"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
build: | ||
docker build -t gliderlabs/consul:$(VERSION) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
[[ "$TRACE" ]] && set -x || : | ||
|
||
debug() { | ||
[[ "$DEBUG" ]] && echo "-----> $*" 1>&2 | ||
} | ||
|
||
consul_version() { | ||
sed -n "s/ENV CONSUL_VERSION //p" Dockerfile | ||
} | ||
|
||
next_version() { | ||
debug "new version will be calculated ..." | ||
local oldVersion=$(consul_version) | ||
debug "oldVersion: $oldVersion" | ||
echo ${oldVersion%.*}.$((${oldVersion##*.} + 1)) | ||
} | ||
|
||
update_dockerfile() { | ||
declare ver=${1:? required} | ||
|
||
local sha=$(curl -Ls https://releases.hashicorp.com/consul/${ver}/consul_${ver}_SHA256SUMS | sed -n "s/ .*linux_amd64.*//p") | ||
debug "sha=$sha" | ||
|
||
sed -i "s/\(ENV CONSUL_VERSION\) .*/\1 $newVersion/;s/\(ENV CONSUL_SHA256\) .*/\1 $sha/" Dockerfile | ||
} | ||
|
||
main() { | ||
declare desc="Updates Dockerfile url/sha for the provided version, or calculates next patch version if called without params" | ||
declare newVersion=${1:-$(next_version)} | ||
|
||
debug "newVersion=$newVersion" | ||
update_dockerfile $newVersion | ||
git diff | ||
echo "=====> Now you can run: git commit -am 'Upgrade Consul to $newVersion'" | ||
} | ||
|
||
[[ "$0" == "$BASH_SOURCE" ]] && main "$@" || : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION=0.6 | ||
VERSION=0.7 | ||
|
||
build: | ||
VERSION=$(VERSION) make -C $(VERSION)/consul | ||
|