@@ -75,10 +75,6 @@ if [ -f Dockerfile ]; then
7575 USING_DOCKERFILE=true
7676fi
7777
78- if [ -f Procfile ]; then
79- PROCFILE=$( cat Procfile)
80- fi
81-
8278# pull config from controller to be used during build
8379URL=" {{ .deis_controller_protocol }}://{{ .deis_controller_host }}:{{ .deis_controller_port }}/v1/hooks/config"
8480RESPONSE=$( /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"
139135docker push $TMP_IMAGE & > /dev/null
140136echo
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)
144143else
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=" {}"
154145fi
155146
156147puts-step " Launching... "
157148URL=" {{ .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 " )
159150PUBLISH_RELEASE=$( echo " $DATA " | /app/bin/publish-release-controller -url=$URL -key={{ .deis_controller_builderKey }})
160151
161152CODE=$?
0 commit comments