Skip to content

Commit 1701ad4

Browse files
committed
fix(builder): ping remote storage
when builder is configured to upload to remote storage
1 parent e0547b7 commit 1701ad4

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

rootfs/etc/confd/templates/builder

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ fi
9898
git archive --format=tar.gz ${GIT_SHA} > ${APP_NAME}.tar.gz
9999

100100
HTTP_PREFIX="http"
101+
REMOTE_STORAGE="0"
101102
# if minio is in the cluster, use it. otherwise use fetcher
102103
# TODO: figure out something for using S3 also
103104
if [[ -n "$DEIS_MINIO_SERVICE_HOST" && -n "$DEIS_MINIO_SERVICE_PORT" ]]; then
104105
S3EP=${DEIS_MINIO_SERVICE_HOST}:${DEIS_MINIO_SERVICE_PORT}
106+
REMOTE_STORAGE="1"
105107
elif [[ -n "$DEIS_OUTSIDE_STORAGE_HOST" && -n "$DEIS_OUTSIDE_STORAGE_PORT" ]]; then
106108
HTTP_PREFIX="https"
107109
S3EP=${DEIS_OUTSIDE_STORAGE_HOST}:${DEIS_OUTSIDE_STORAGE_PORT}
110+
REMOTE_STORAGE="1"
108111
elif [ -z "$S3EP" ]; then
109112
S3EP=${HOST}:3000
110113
fi
@@ -136,11 +139,21 @@ kubectl --namespace=$POD_NAMESPACE create -f /etc/${SLUG_NAME}.yaml
136139

137140
#check for image creation or slug existence in S3EP
138141

139-
while [ ! -f /apps/${SLUG_NAME}/slug.tgz ]
140-
do
141-
sleep 2
142-
echo "no file"
143-
done
142+
if [[ "$REMOTE_STORAGE" == "1" ]]; then
143+
$MC_PREFIX ls $PUSH_URL
144+
while [ "$?" == "1" ]
145+
do
146+
sleep 2
147+
echo "no file"
148+
$MC_PREFIX ls $PUSH_URL
149+
done
150+
else
151+
while [ ! -f /apps/${SLUG_NAME}/slug.tgz ]
152+
do
153+
sleep 2
154+
echo "no file"
155+
done
156+
fi
144157

145158
URL="http://$DEIS_WORKFLOW_SERVICE_HOST:$DEIS_WORKFLOW_SERVICE_PORT/v2/hooks/config"
146159
RESPONSE=$(get-app-config -url="$URL" -key="{{ getv "/deis/controller/builderKey" }}" -user=$USER -app=$APP_NAME)

0 commit comments

Comments
 (0)