--- name: ssh-test-deploy description: Deploy and test a module JAR on a PAISY SSH test instance. --- # Skill: ssh-test-deploy Deploy and test a module JAR on a PAISY SSH test instance. ## Invoked by 💻 Code mode (or 🪃 Orchestrator delegating to Code) ## Required Inputs | Input | Source | Example | |-------|--------|---------| | `TICKET_KEY` | Jira issue key | `ESIDEPAISY-12081` | | `MODULE` | PAISY module name | `eau`, `eubp`, `svmeldungen`, `dabpv` | | `PROGRAM` | PAI program to run | `PAI022`, `PAIBATCH`, `PAI030` | | `PROGRAM_ARGS` | Program arguments (optional) | `"-eau"`, `"-svmeldungen DSAK"` | ## Steps ### 1. List available test instances ```python list-instances() ``` Pick an appropriate instance based on module and availability. If the user has a preferred instance, use that. ### 2. Select the instance ```python set-instance(instance="") ``` ### 3. Build the module JAR locally ```bash cd /Users/pplate/git/paisy- mvn package -pl java/modules/cs-modules/ -am -DskipTests -f java/pom.xml ``` Locate the built JAR: ```bash find java/modules/cs-modules//target -name "*.jar" -not -name "*-sources.jar" | head -1 ``` ### 3.5. Check existing JAR filename on instance Before uploading, always check what the existing JAR is named on the instance. PAISY instances use specific casing conventions (e.g., `EUBP.jar` not `eubp.jar`, `EAU.jar` not `eau.jar`). ```python exec-command(command="ls -la /user2/paisyhr//JAR/** /user2/paisyhr//JAR/** 2>/dev/null") ``` - Extract the exact filename (e.g., `EUBP.jar`) - Use this as the `remoteFilename` parameter in `upload-file` - If no existing JAR is found, use the module name in UPPERCASE: `.jar` Known JAR naming conventions: | Module | JAR filename | |--------|-------------| | eubp | `EUBP.jar` | | eau | `EAU.jar` | | svmodules | `SVMeldungen.jar` | | dabpv | `DaBPV.jar` | | rvbea | `RVBEA.jar` | | dsbd | `DSBD.jar` | | dsvv | `DSVV.jar` | ### 4. Upload JAR to instance ```python upload-file( localPath="", remoteFilename="" # e.g., "EUBP.jar" — from step 3.5 ) ``` ### 5. Run the program ```python run-program( program="", args="" ) ``` For common programs: | Program | Purpose | Typical args | |---------|---------|-------------| | `PAI022` | SV-Meldeverfahren batch | `"-svmeldungen DSAK"`, `"-svmeldungen DSBD"` | | `PAIBATCH` | General batch runner | module-specific | | `PAI030` | Lohnsteuer | `"-lstb"` | | `PAI028` | SVD import | (no args, reads SVD.XML) | ### 6. Parse output Check the program output for errors: ```python # PAISY error responses start with "F;" # Success responses typically start with "0;" or contain "RC=0" ``` | Pattern | Meaning | Action | |---------|---------|--------| | `F;` prefix | PAISY error | Log error, report to user | | `RC=0` | Success | Continue | | `RC=4` | Warning | Log warning, review output | | `RC=8` or higher | Error | Log error, investigate | ### 7. Verify with shell command (optional) ```python exec-command(command="ls -la /path/to/output/") exec-command(command="cat /path/to/logfile.log | tail -50") ``` ### 8. Log results to BigMind ```python memory_store_fact( category="codebase", fact=f"{TICKET_KEY}: SSH test on — {PROGRAM} {PROGRAM_ARGS} → RC={rc}. " ) memory_append_chunk( session_id=SESSION_ID, content=f"SSH test deploy for {TICKET_KEY}:\nInstance: \nProgram: {PROGRAM}\nResult: ", flag_reason="SSH test result" ) ``` ## Expected Output - Module JAR built and uploaded to test instance - Program executed with output captured - Results logged to BigMind - Error/success status reported to user ## Error Handling | Error | Resolution | |-------|------------| | No instances available | `list-instances()` returns empty — ask user to check VPN/SSH access | | Build failure | Check Maven output for compilation errors, fix before retrying | | Upload failure | Verify instance is reachable, check disk space with `exec-command("df -h")` | | `F;` response | Parse error code, check ADP Docs Wiki for error meaning | | `RC=15` | Often means SVD.XML is outdated — run PAI028 first to import fresh SVD data | | Connection timeout | Instance may be down — try another instance from `list-instances()` | | Wrong JAR filename | Always check existing name first — PAISY is case-sensitive on JAR names | ## Common Workflows ### EAU test ```python set-instance(instance="Nadine.123") run-program(program="PAI022", args="-eau") ``` ### SVMeldungen DSAK test ```python set-instance(instance="Tanja.122") run-program(program="PAI022", args="-svmeldungen DSAK") ``` ### Full batch test ```python # First update SVD data run-program(program="PAI028") # Then run the batch run-program(program="PAIBATCH", args="") ``` ## Language - Log entries and BigMind facts: English - Error descriptions from PAISY: German (preserve as-is) - User-facing summaries: match user's language