Skip to content

Commit a0db901

Browse files
author
Matthew Fisher
committed
ref(builder): copy rootfs to /
1 parent 3aa63da commit a0db901

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

builder/rootfs/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ RUN chown -R $GITUSER:$GITUSER $GITHOME
4444
# use VOLUME to remove /var/lib/docker from copy-on-write for performance
4545
# we don't want to stack overlay filesystems
4646
VOLUME /var/lib/docker
47-
WORKDIR /app
48-
ENTRYPOINT ["/app/bin/entry"]
49-
CMD ["/app/bin/boot"]
47+
48+
ENTRYPOINT ["/bin/entry"]
49+
CMD ["/bin/boot"]
5050
EXPOSE 22
5151
RUN addgroup -g 2000 slug && adduser -D -u 2000 -G slug slug
5252

@@ -57,8 +57,6 @@ RUN addgroup $GITUSER docker
5757
RUN addgroup $GITUSER slug
5858
RUN passwd -u git
5959

60-
ADD etc /etc
61-
ADD . /app
62-
RUN chown -R root:root /app
60+
COPY . /
6361

6462
ENV DEIS_RELEASE 1.7.0-dev

builder/rootfs/etc/confd/templates/builder

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fi
7777

7878
# pull config from controller to be used during build
7979
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)
80+
RESPONSE=$(get-app-config -url="$URL" -key="{{ getv "/deis/controller/builderKey" }}" -user=$USER -app=$APP_NAME)
8181
CODE=$?
8282

8383
if [ $CODE -ne 0 ]; then
@@ -89,7 +89,7 @@ BUILD_OPTS=()
8989
BUILD_OPTS+='/usr/bin/docker'
9090
BUILD_OPTS+=' run -v /etc/environment_proxy:/etc/environment_proxy'
9191
# get application configuration
92-
BUILD_OPTS+=$(echo $RESPONSE | /app/bin/get-app-values)
92+
BUILD_OPTS+=$(echo $RESPONSE | get-app-values)
9393

9494
# if no Dockerfile is present, use slugbuilder to compile a heroku slug
9595
# and write out a Dockerfile to use that slug
@@ -136,24 +136,24 @@ echo
136136

137137
# use Procfile if provided, otherwise try default process types from ./release
138138
if [ -f Procfile ]; then
139-
PROCFILE=$(cat Procfile | /app/bin/yaml2json-procfile)
139+
PROCFILE=$(cat Procfile | yaml2json-procfile)
140140
elif [ -f $TMP_DIR/slug.tgz ]; then
141141
# Sometimes, the buildpack will generate a Procfile instead of populating /bin/release
142142
# /bin/release was unofficially deprecated for declaring default process types
143143
if tar -tf $TMP_DIR/slug.tgz ./Procfile &> /dev/null;
144144
then
145-
PROCFILE="$(tar --to-stdout -xf $TMP_DIR/slug.tgz ./Procfile | /app/bin/yaml2json-procfile)"
145+
PROCFILE="$(tar --to-stdout -xf $TMP_DIR/slug.tgz ./Procfile | yaml2json-procfile)"
146146
else
147-
PROCFILE=$(tar --to-stdout -xf $TMP_DIR/slug.tgz ./.release | /app/bin/extract-types)
147+
PROCFILE=$(tar --to-stdout -xf $TMP_DIR/slug.tgz ./.release | extract-types)
148148
fi
149149
else
150150
PROCFILE="{}"
151151
fi
152152

153153
puts-step "Launching... "
154154
URL="{{ getv "/deis/controller/protocol" }}://{{ getv "/deis/controller/host" }}:{{ getv "/deis/controller/port" }}/v1/hooks/build"
155-
DATA=$(/app/bin/generate-buildhook "$SHORT_SHA" "$USER" "$APP_NAME" "$APP_NAME" "$PROCFILE" "$USING_DOCKERFILE")
156-
PUBLISH_RELEASE=$(echo "$DATA" | /app/bin/publish-release-controller -url=$URL -key={{ getv "/deis/controller/builderKey" }})
155+
DATA=$(generate-buildhook "$SHORT_SHA" "$USER" "$APP_NAME" "$APP_NAME" "$PROCFILE" "$USING_DOCKERFILE")
156+
PUBLISH_RELEASE=$(echo "$DATA" | publish-release-controller -url=$URL -key={{ getv "/deis/controller/builderKey" }})
157157

158158
CODE=$?
159159
if [ $CODE -ne 0 ]; then
@@ -162,8 +162,8 @@ if [ $CODE -ne 0 ]; then
162162
exit 1
163163
fi
164164

165-
RELEASE=$(echo $PUBLISH_RELEASE | /app/bin/extract-version)
166-
DOMAIN=$(echo $PUBLISH_RELEASE | /app/bin/extract-domain)
165+
RELEASE=$(echo $PUBLISH_RELEASE | extract-version)
166+
DOMAIN=$(echo $PUBLISH_RELEASE | extract-domain)
167167
indent "done, $APP_NAME:v$RELEASE deployed to Deis"
168168
echo
169169
indent "http://$DOMAIN"

0 commit comments

Comments
 (0)