Commit 8791c86
fix: correct argument parsing in deploy-stacks.sh remote script
Fixes incorrect TARGET_REF extraction in SSH heredoc that was causing
the script to use a stack name instead of the commit SHA.
Previous buggy logic tried to detect if COMPOSE_ARGS was present by
checking for hyphens/equals, but when COMPOSE_ARGS is an empty string
it's still passed as an argument, causing incorrect parsing:
- STACKS included the TARGET_REF SHA
- TARGET_REF was set to the last stack name
New logic is simpler and more reliable:
- COMPOSE_ARGS is ALWAYS the last argument (could be empty "")
- TARGET_REF is ALWAYS the second-to-last argument
- STACKS are everything before the last 2 arguments
This fixes output like:
'Updating repository to portainer...'
Instead of:
'Updating repository to d14597a8b89b5aa58781cfb68036132fcbb63a99...'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 1474507 commit 8791c86
1 file changed
+14
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
145 | 118 | | |
146 | 119 | | |
147 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
148 | 130 | | |
149 | 131 | | |
150 | 132 | | |
| |||
0 commit comments