@@ -46,64 +46,17 @@ runs:
|
|||||||
COMPOSE_PROJECT_NAME=${{ inputs.project_name }}
|
COMPOSE_PROJECT_NAME=${{ inputs.project_name }}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Debug environment file
|
- name: Remove old Docker context
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: 'docker context rm deploy_target 2>/dev/null || true'
|
||||||
echo "=== ENVIRONMENT FILE DEBUG ==="
|
|
||||||
echo "File path: ${{ inputs.environment_file }}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Check if file exists
|
|
||||||
if [ -f "${{ inputs.environment_file }}" ]; then
|
|
||||||
echo "✅ Environment file exists"
|
|
||||||
|
|
||||||
# Show file size and permissions
|
|
||||||
ls -la "${{ inputs.environment_file }}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Show file contents
|
|
||||||
echo "📄 File contents:"
|
|
||||||
echo "---"
|
|
||||||
cat "${{ inputs.environment_file }}"
|
|
||||||
echo "---"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Show line count
|
|
||||||
LINE_COUNT=$(wc -l < "${{ inputs.environment_file }}")
|
|
||||||
echo "📊 File has $LINE_COUNT lines"
|
|
||||||
|
|
||||||
# Check for empty lines or whitespace issues
|
|
||||||
echo "🔍 Checking for issues:"
|
|
||||||
if grep -q "^$" "${{ inputs.environment_file }}"; then
|
|
||||||
echo "⚠️ File contains empty lines"
|
|
||||||
else
|
|
||||||
echo "✅ No empty lines found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Validate each variable is set
|
|
||||||
echo "🔧 Variable validation:"
|
|
||||||
while IFS='=' read -r key value; do
|
|
||||||
if [ -n "$key" ] && [ -n "$value" ]; then
|
|
||||||
echo " ✅ $key = $value"
|
|
||||||
elif [ -n "$key" ]; then
|
|
||||||
echo " ❌ $key is empty"
|
|
||||||
fi
|
|
||||||
done < "${{ inputs.environment_file }}"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "❌ Environment file does not exist!"
|
|
||||||
fi
|
|
||||||
echo "=============================="
|
|
||||||
|
|
||||||
- name: Create Docker context
|
- name: Create Docker context
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: 'docker context create deploy_target --docker "host=ssh://${{ vars.ssh_user }}@${{ vars.ssh_host }}:${{ vars.ssh_port }}"'
|
||||||
docker context rm deploy_target 2>/dev/null || true
|
|
||||||
|
|
||||||
docker context create deploy_target \
|
- name: Validate Docker context
|
||||||
--docker "host=ssh://${{ vars.ssh_user }}@${{ vars.ssh_host }}:${{ vars.ssh_port }}"
|
shell: bash
|
||||||
|
run: 'docker --context deploy_target info'
|
||||||
docker --context deploy_target info
|
|
||||||
|
|
||||||
- name: Stop existing deployment
|
- name: Stop existing deployment
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user