Skip to content

Commit 8baab77

Browse files
author
Matthew Fisher
committed
chore(builder): bump confd to v0.8
1 parent 8176ad6 commit 8baab77

8 files changed

Lines changed: 17 additions & 22 deletions

File tree

builder/image/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdem
1010
&& chmod +x /usr/local/bin/etcdctl
1111

1212
# install confd
13-
RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json \
13+
RUN curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.8.0/confd-0.8.0-linux-amd64 \
1414
&& chmod +x /usr/local/bin/confd
1515

1616
# install docker-in-docker

builder/image/bin/boot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ function etcd_safe_mkdir {
4141
etcd_safe_mkdir $ETCD_PATH/users
4242

4343
# wait for confd to run once and install initial templates
44-
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
44+
until confd -onetime -node $ETCD --confdir /app --interval 5 --quiet; do
4545
echo "builder: waiting for confd to write initial templates..."
4646
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
4747
done
4848

4949
# spawn confd in the background to update services based on etcd changes
50-
confd -node $ETCD -config-file /app/confd.toml &
50+
confd -node $ETCD --confdir /app --interval 5 --quiet &
5151
CONFD_PID=$!
5252

5353
# remove any pre-existing docker.sock

builder/image/confd.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{{ range $user := .deis_builder_users }}{{ range $key := $user.Nodes }}
2-
command="/usr/local/bin/gitreceive run {{ Base $user.Key }} {{ Base $key.Key }}",no-agent-forwarding,no-pty,no-user-rc,no-X11-forwarding,no-port-forwarding {{ $key.Value }}
3-
{{ end }}{{ end }}
1+
{{ range $user := lsdir "/deis/builder/users" }}{{ range gets (print "/deis/builder/users/" $user "/*") }}
2+
command="/usr/local/bin/gitreceive run {{ $user }} {{ base .Key }}",no-agent-forwarding,no-pty,no-user-rc,no-X11-forwarding,no-port-forwarding {{ .Value }}
3+
{{ end }}{{ end }}

builder/image/templates/builder

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CACHE_DIR="${REPO_DIR}/cache"
5656

5757
# define image names
5858
IMAGE_NAME="$APP_NAME:git-$SHORT_SHA"
59-
TMP_IMAGE="{{ .deis_registry_host }}:{{ .deis_registry_port }}/$IMAGE_NAME"
59+
TMP_IMAGE="{{ getv "/deis/registry/host" }}:{{ getv "/deis/registry/port" }}/$IMAGE_NAME"
6060

6161
# create app directories
6262
mkdir -p $BUILD_DIR $CACHE_DIR
@@ -76,8 +76,8 @@ if [ -f Dockerfile ]; then
7676
fi
7777

7878
# pull config from controller to be used during build
79-
URL="{{ .deis_controller_protocol }}://{{ .deis_controller_host }}:{{ .deis_controller_port }}/v1/hooks/config"
80-
RESPONSE=$(/app/bin/get-app-config -url="$URL" -key="{{ .deis_controller_builderKey }}" -user=$USER -app=$APP_NAME)
79+
URL="{{ getv "/deis/controller/protocol" }}://{{ getv "/deis/controller/host" }}:{{ getv "/deis/controller/port" }}/v1/hooks/config"
80+
RESPONSE=$(/app/bin/get-app-config -url="$URL" -key="{{ getv "/deis/controller/builderKey" }}" -user=$USER -app=$APP_NAME)
8181
CODE=$?
8282

8383
if [ $CODE -ne 0 ]; then
@@ -144,9 +144,9 @@ else
144144
fi
145145

146146
puts-step "Launching... "
147-
URL="{{ .deis_controller_protocol }}://{{ .deis_controller_host }}:{{ .deis_controller_port }}/v1/hooks/build"
147+
URL="{{ getv "/deis/controller/protocol" }}://{{ getv "/deis/controller/host" }}:{{ getv "/deis/controller/port" }}/v1/hooks/build"
148148
DATA=$(/app/bin/generate-buildhook "$SHORT_SHA" "$USER" "$APP_NAME" "$APP_NAME" "$PROCFILE" "$USING_DOCKERFILE")
149-
PUBLISH_RELEASE=$(echo "$DATA" | /app/bin/publish-release-controller -url=$URL -key={{ .deis_controller_builderKey }})
149+
PUBLISH_RELEASE=$(echo "$DATA" | /app/bin/publish-release-controller -url=$URL -key={{ getv "/deis/controller/builderKey" }})
150150

151151
CODE=$?
152152
if [ $CODE -ne 0 ]; then

builder/image/templates/check-repos

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ cd $(dirname $0) # absolute path
1212
for repo in *.git;
1313
do
1414
reponame="${repo%.*}"
15-
appname="{{ .deis_registry_host }}:{{ .deis_registry_port }}/$reponame"
16-
if ! listcontains "{{ range $services := .deis_services }}{{ Base $services.Key }} {{ end }}" "$reponame";
15+
appname="{{ getv "/deis/registry/host" }}:{{ getv "/deis/registry/port" }}/$reponame"
16+
if ! listcontains "{{ join (lsdir "/deis/services/*") " " }}" "$reponame";
1717
then
1818
rm -rf "$repo"
1919
docker images | grep $appname | awk '{ print $3 }' | xargs docker rmi -f

builder/image/templates/push-images

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ until docker history deis/slugrunner >/dev/null 2>&1; do
66
done
77

88
# tag and push
9-
docker tag deis/slugrunner:latest {{ .deis_registry_host }}:{{ .deis_registry_port }}/deis/slugrunner:latest
10-
docker push {{ .deis_registry_host }}:{{ .deis_registry_port }}/deis/slugrunner:latest
9+
docker tag deis/slugrunner:latest {{ getv "/deis/registry/host" }}:{{ getv "/deis/registry/port" }}/deis/slugrunner:latest
10+
docker push {{ getv "/deis/registry/host" }}:{{ getv "/deis/registry/port" }}/deis/slugrunner:latest

builder/image/templates/receiver

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ fingerprint=$4
1010
curl \
1111
-X 'POST' --fail \
1212
-H 'Content-Type: application/json' \
13-
-H "X-Deis-Builder-Auth: {{ .deis_controller_builderKey }}" \
13+
-H "X-Deis-Builder-Auth: {{ getv "/deis/controller/builderKey" }}" \
1414
-d "{\"receive_user\": \"$username\", \"receive_repo\": \"$app\", \"sha\": \"$sha\", \"fingerprint\": \"$fingerprint\", \"ssh_connection\": \"$SSH_CONNECTION\", \"ssh_original_command\": \"$SSH_ORIGINAL_COMMAND\"}" \
15-
--silent http://{{ .deis_controller_host }}:{{ .deis_controller_port }}/v1/hooks/push >/dev/null
15+
--silent {{ getv "/deis/controller/protocol" }}://{{ getv "/deis/controller/host" }}:{{ getv "/deis/controller/port" }}/v1/hooks/push >/dev/null

0 commit comments

Comments
 (0)