Skip to content

Commit 007d4e0

Browse files
author
Gabriel Monroy
committed
Merge pull request #2909 from gabrtv/fix-proctypes
fix(builder): allow procfile to override default process types
2 parents b573711 + f2d2f2f commit 007d4e0

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

builder/image/templates/builder

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ if [ -f Dockerfile ]; then
7575
USING_DOCKERFILE=true
7676
fi
7777

78-
if [ -f Procfile ]; then
79-
PROCFILE=$(cat Procfile)
80-
fi
81-
8278
# pull config from controller to be used during build
8379
URL="{{ .deis_controller_protocol }}://{{ .deis_controller_host }}:{{ .deis_controller_port }}/v1/hooks/config"
8480
RESPONSE=$(/app/bin/get-app-config -url="$URL" -key="{{ .deis_controller_builderKey }}" -user=$USER -app=$APP_NAME)
@@ -139,23 +135,18 @@ puts-step "Pushing image to private registry"
139135
docker push $TMP_IMAGE &>/dev/null
140136
echo
141137

142-
if [ -f $TMP_DIR/slug.tgz ]; then
143-
RELEASE_INFO=$(tar --to-stdout -xf $TMP_DIR/slug.tgz ./.release | /app/bin/extract-types)
138+
# use Procfile if provided, otherwise try default process types from ./release
139+
if [ -f Procfile ]; then
140+
PROCFILE=$(cat Procfile | /app/bin/yaml2json-procfile)
141+
elif [ -f $TMP_DIR/slug.tgz ]; then
142+
PROCFILE=$(tar --to-stdout -xf $TMP_DIR/slug.tgz ./.release | /app/bin/extract-types)
144143
else
145-
RELEASE_INFO="{}"
146-
fi
147-
148-
if [ "$RELEASE_INFO" == "{}" ]; then
149-
if [ -f $TMP_DIR/Procfile ]; then
150-
# fall back to Procfile if there's no default process types
151-
# FIXME: refactor into slugbuilder
152-
RELEASE_INFO=$(cat $TMP_DIR/Procfile | /app/bin/yaml2json-procfile)
153-
fi
144+
PROCFILE="{}"
154145
fi
155146

156147
puts-step "Launching... "
157148
URL="{{ .deis_controller_protocol }}://{{ .deis_controller_host }}:{{ .deis_controller_port }}/v1/hooks/build"
158-
DATA=$(/app/bin/generate-buildhook "$SHORT_SHA" "$USER" "$APP_NAME" "$APP_NAME" "$RELEASE_INFO" "$USING_DOCKERFILE")
149+
DATA=$(/app/bin/generate-buildhook "$SHORT_SHA" "$USER" "$APP_NAME" "$APP_NAME" "$PROCFILE" "$USING_DOCKERFILE")
159150
PUBLISH_RELEASE=$(echo "$DATA" | /app/bin/publish-release-controller -url=$URL -key={{ .deis_controller_builderKey }})
160151

161152
CODE=$?

0 commit comments

Comments
 (0)