From fd1cae8b70be508b62f055121ac0774968a04501 Mon Sep 17 00:00:00 2001 From: MrMatiz2 Date: Tue, 15 Jul 2025 10:34:43 -0500 Subject: [PATCH] deploy-node-windows added and new S4DS Node name --- deploy-node-windows.sh | 45 +++++++++++++++++++++++++++++++++ nodes/S4DSMain/S4DSMain.node.ts | 4 +-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 deploy-node-windows.sh diff --git a/deploy-node-windows.sh b/deploy-node-windows.sh new file mode 100644 index 0000000..67a24fe --- /dev/null +++ b/deploy-node-windows.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Exit immediately if a command fails. +set -e + +############################## +# Step 0: Get Package Name +############################## +PACKAGE_NAME=$(node -p "require('./package.json').name") + +if [ -z "$PACKAGE_NAME" ]; then + echo "❌ Error: Could not determine package name from package.json." + exit 1 +fi + +echo "📦 Detected package name: '$PACKAGE_NAME'" + +############################## +# Step 1: Build the Node +############################## +echo "🔨 Building the node..." +pnpm run build + +############################## +# Step 2: Deploy the Build Output +############################## +SOURCE_DIR="D:\\Users\\aleja\\Code\\n8n-nodes-starter-s4ds\\dist" + +echo "🚀 Deploying build output from '$SOURCE_DIR' to Docker volume..." + +docker run --rm \ + -v n8n-nodes-starter-s4ds_n8n_data:/data \ + -v "${SOURCE_DIR}:/build" \ + alpine sh -c "mkdir -p /data/custom/$PACKAGE_NAME && cp -r /build/* /data/custom/$PACKAGE_NAME/" + +echo "✅ Deployment complete." + +############################## +# Step 3: Restart n8n +############################## +echo "♻️ Restarting n8n container..." +docker container restart n8n-nodes-starter-s4ds-n8n-1 + +echo "📄 Streaming logs..." +docker logs -f n8n-nodes-starter-s4ds-n8n-1 diff --git a/nodes/S4DSMain/S4DSMain.node.ts b/nodes/S4DSMain/S4DSMain.node.ts index 02d4fcd..43b63c9 100644 --- a/nodes/S4DSMain/S4DSMain.node.ts +++ b/nodes/S4DSMain/S4DSMain.node.ts @@ -3,7 +3,7 @@ import { ApiHelper } from './ApiHelper'; export class S4DSMain implements INodeType { description: INodeTypeDescription = { - displayName: 'S4DS', + displayName: 'S4DS\'s APIs', name: 's4ds', icon: { light: 'file:logo_generic.png', dark: 'file:logo_generic.png' }, group: ['transform'], @@ -11,7 +11,7 @@ export class S4DSMain implements INodeType { subtitle: '={{$parameter["resource"]}} - {{$parameter["operation"]}}', description: 'S4DS API operations including authentication and product management', defaults: { - name: 'S4DS', + name: 'S4DS\'s APIs', }, inputs: [NodeConnectionType.Main], outputs: [NodeConnectionType.Main],