Skip to content

Commit 4bb5a52

Browse files
committed
Support deployments without dockerfiles (Ref #118)
1 parent c649abf commit 4bb5a52

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/actions/deploy.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ action_deploy() {
195195
# Clean up services on exit
196196
trap cleanup_on_exit EXIT
197197

198-
# Check if any Dockerfiles exist
199-
dockerfiles=$(ls Dockerfile* 2>/dev/null)
200-
if [[ -n "$dockerfiles" ]]; then
198+
# Check if any Dockerfiles exist (using safer glob handling)
199+
shopt -s nullglob
200+
dockerfiles=( Dockerfile* )
201+
shopt -u nullglob
202+
if [[ ${#dockerfiles[@]} -gt 0 ]]; then
201203
# Bring up a local docker registry
202204
if [ -z "$(docker ps -q -f name=$spin_registry_name)" ]; then
203205
# Ensure the registry cache directory exists with the correct user and group ID
@@ -228,6 +230,8 @@ action_deploy() {
228230
exit 1
229231
fi
230232
done
233+
else
234+
echo "${BOLD}${YELLOW}🐳 No Dockerfiles found in the directory. Skipping Docker image build...${RESET}"
231235
fi
232236

233237
# Get deployment host information

0 commit comments

Comments
 (0)