-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfd08bf
commit 6a913de
Showing
21 changed files
with
116 additions
and
50 deletions.
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
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
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,6 +1,6 @@ | ||
hostname: {{getenv "HOSTNAME"}} | ||
hostname: {{ getenv "HOSTNAME" }} | ||
[database] | ||
host={{getv "/database/host"}} | ||
password={{getv "/database/password"}} | ||
port={{getv "/database/port"}} | ||
username={{getv "/database/username"}} | ||
host={{ getv "/database/host" }} | ||
password={{ getv "/database/password" }} | ||
port={{ getv "/database/port" }} | ||
username={{ getv "/database/username" }} |
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,8 +1,2 @@ | ||
{{if exists "/key"}} | ||
value: {{getv "/key"}} | ||
{{end}} | ||
|
||
{{if exists "/doesnotexist"}} | ||
This line will not be printed | ||
value: {{getv "/key"}} | ||
{{end}} | ||
{{ if exists "/key" }}value: {{ getv "/key" }}{{ end }} | ||
{{- if exists "/doesnotexist" }}This line will not be printed value: {{ getv "/key" }}{{ end }} |
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
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
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,12 +1,25 @@ | ||
#!/bin/bash | ||
|
||
export HOSTNAME="localhost" | ||
|
||
# Configure consul | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/key -d 'foobar' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/database/host -d '127.0.0.1' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/database/password -d 'p@sSw0rd' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/database/port -d '3306' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/database/username -d 'confd' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/upstream/app1 -d '10.0.1.10:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/upstream/app2 -d '10.0.1.11:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/nested/east/app1 -d '10.0.1.10:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/nested/west/app2 -d '10.0.1.11:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/database/host -d '127.0.0.1' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/database/password -d 'p@sSw0rd' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/database/port -d '3306' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/database/username -d 'confd' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/upstream/app1 -d '10.0.1.10:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/upstream/app2 -d '10.0.1.11:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/nested/east/app1 -d '10.0.1.10:8080' | ||
curl -X PUT http://127.0.0.1:8500/v1/kv/prefix/nested/west/app2 -d '10.0.1.11:8080' | ||
|
||
# Run confd | ||
confd --onetime --log-level debug --confdir ./integration/confdir --backend consul --node 127.0.0.1:8500 |
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
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
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
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,19 +1,21 @@ | ||
#!/bin/bash | ||
|
||
ETCDCTL_API=3 etcdctl put /key foobar | ||
ETCDCTL_API=3 etcdctl put /database/host 127.0.0.1 | ||
ETCDCTL_API=3 etcdctl put /database/password p@sSw0rd | ||
ETCDCTL_API=3 etcdctl put /database/port 3306 | ||
ETCDCTL_API=3 etcdctl put /database/username confd | ||
ETCDCTL_API=3 etcdctl put /upstream/app1 10.0.1.10:8080 | ||
ETCDCTL_API=3 etcdctl put /upstream/app2 10.0.1.11:8080 | ||
ETCDCTL_API=3 etcdctl put /prefix/database/host 127.0.0.1 | ||
ETCDCTL_API=3 etcdctl put /prefix/database/password p@sSw0rd | ||
ETCDCTL_API=3 etcdctl put /prefix/database/port 3306 | ||
ETCDCTL_API=3 etcdctl put /prefix/database/username confd | ||
ETCDCTL_API=3 etcdctl put /prefix/upstream/app1 10.0.1.10:8080 | ||
ETCDCTL_API=3 etcdctl put /prefix/upstream/app2 10.0.1.11:8080 | ||
export HOSTNAME="localhost" | ||
export ETCDCTL_API="3" | ||
|
||
etcdctl put /key foobar | ||
etcdctl put /database/host 127.0.0.1 | ||
etcdctl put /database/password p@sSw0rd | ||
etcdctl put /database/port 3306 | ||
etcdctl put /database/username confd | ||
etcdctl put /upstream/app1 10.0.1.10:8080 | ||
etcdctl put /upstream/app2 10.0.1.11:8080 | ||
etcdctl put /prefix/database/host 127.0.0.1 | ||
etcdctl put /prefix/database/password p@sSw0rd | ||
etcdctl put /prefix/database/port 3306 | ||
etcdctl put /prefix/database/username confd | ||
etcdctl put /prefix/upstream/app1 10.0.1.10:8080 | ||
etcdctl put /prefix/upstream/app2 10.0.1.11:8080 | ||
|
||
# Run confd | ||
confd --onetime --log-level debug --confdir ./integration/confdir --backend etcdv3 --node http://127.0.0.1:2379 --watch |
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 @@ | ||
hostname: localhost | ||
[database] | ||
host=127.0.0.1 | ||
password=p@sSw0rd | ||
port=3306 | ||
username=confd |
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 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
diff /tmp/confd-basic-test.conf integration/expect/basic.conf | ||
diff /tmp/confd-exists-test.conf integration/expect/exists-test.conf | ||
diff /tmp/confd-iteration-test.conf integration/expect/iteration.conf |
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 @@ | ||
value: foobar |
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 @@ | ||
upstream app { | ||
server 10.0.1.10:8080; | ||
server 10.0.1.11:8080; | ||
} | ||
|
||
server { | ||
server_name www.example.com; | ||
location / { | ||
proxy_pass http://app; | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |
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,5 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export HOSTNAME="localhost" | ||
|
||
cat <<EOT >> test.yaml | ||
key: foobar | ||
database: | ||
|
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,5 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export HOSTNAME="localhost" | ||
|
||
cat > ./rancher-answers.json<<EOF | ||
{ | ||
"2015-07-25": { | ||
|
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
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
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
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,8 +1,10 @@ | ||
#!/bin/bash | ||
|
||
export HOSTNAME="localhost" | ||
|
||
# feed zookeeper | ||
export ZK_PATH="`dirname \"$0\"`" | ||
sh -c "cd $ZK_PATH ; go run main.go" | ||
sh -c "cd $ZK_PATH; go run main.go" | ||
|
||
# Run confd | ||
confd --onetime --log-level debug --confdir ./integration/confdir --interval 5 --backend zookeeper --node 127.0.0.1:2181 -watch |