Fix CI/CD: remove duplicate apk commands and fix YAML structure
Some checks reported errors
continuous-integration/drone/push Build encountered an error

- Consolidated package installation into single apk command
- Fixed YAML syntax by removing duplicate netcat installation
- Properly structured commands section to avoid parsing errors
- This should resolve the 'unmarshal !!map into string' error
This commit is contained in:
2025-11-25 18:22:50 +09:00
parent 42ed981d16
commit 237515b812

View File

@@ -197,7 +197,7 @@ steps:
from_secret: staging_key from_secret: staging_key
commands: commands:
- echo "Checking staging environment configuration..." - echo "Checking staging environment configuration..."
- apk add --no-cache openssh-client git curl - apk add --no-cache openssh-client git curl netcat-openbsd
- | - |
if [ -z "$STAGING_HOST" ] || [ -z "$STAGING_USER" ]; then if [ -z "$STAGING_HOST" ] || [ -z "$STAGING_USER" ]; then
echo "⚠️ Staging credentials not configured" echo "⚠️ Staging credentials not configured"
@@ -211,7 +211,6 @@ steps:
- chmod 600 ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H $STAGING_HOST >> ~/.ssh/known_hosts 2>/dev/null || true - ssh-keyscan -H $STAGING_HOST >> ~/.ssh/known_hosts 2>/dev/null || true
- echo "Testing staging server connectivity..." - echo "Testing staging server connectivity..."
- apk add --no-cache netcat-openbsd
- | - |
if ! nc -z $STAGING_HOST 22 2>/dev/null; then if ! nc -z $STAGING_HOST 22 2>/dev/null; then
echo "❌ Cannot connect to staging server on port 22" echo "❌ Cannot connect to staging server on port 22"
@@ -411,14 +410,13 @@ steps:
from_secret: production_user from_secret: production_user
commands: commands:
- echo "Checking production server connectivity..." - echo "Checking production server connectivity..."
- apk add --no-cache openssh-client curl - apk add --no-cache openssh-client curl netcat-openbsd
- | - |
if [ -z "$PROD_HOST" ] || [ -z "$PROD_USER" ]; then if [ -z "$PROD_HOST" ] || [ -z "$PROD_USER" ]; then
echo "❌ Production server credentials not configured" echo "❌ Production server credentials not configured"
exit 1 exit 1
fi fi
- echo "Testing SSH connectivity to $PROD_HOST..." - echo "Testing SSH connectivity to $PROD_HOST..."
- apk add --no-cache netcat-openbsd
- | - |
if ! nc -z $PROD_HOST 22; then if ! nc -z $PROD_HOST 22; then
echo "❌ SSH port 22 is not accessible on $PROD_HOST" echo "❌ SSH port 22 is not accessible on $PROD_HOST"