Comments (6)
@hjalmarhoglund Thanks for reporting this. I'm going to tag in another team member who specializes in deployment and will get back o you!
from redwood.
Thanks for testing this so quickly! I agree we've messed up and introduced an even worse error! I'll get a fix and patch out again for this today
from redwood.
Hey @hjalmarhoglund, would you mind trying out v7.6.1 and confirm that the fix works?
from redwood.
Hey @Josh-Walker-GM! Sure, I've upgraded and tested deploying. I believe another error has been introduced. This time, the error affects both the verbose and the none-verbose baremetal deploys.
Running,
yarn rw deploy baremetal production --verbose
gives the output
...
[STARTED] Cloning `main` branch...
SshExecutor::exec running command `gitclone --branch=main --depth=1 [email protected]:hjalmarhoglund/myapp.git 20240522150326` in /var/www/myapp
[FAILED] Error while running command `gitclone --branch=main --depth=1 [email protected]:hjalmarhoglund/myapp.git 20240522150326` in /var/www/myapp
[FAILED] bash: line 1: gitclone: command not found
Running,
yarn rw deploy baremetal production
gives the output
Error while running command `gitclone --branch=main --depth=1 [email protected]:hjalmarhoglund/myapp.git 20240522150713` in /var/www/myapp
bash: line 1: gitclone: command not found
...
The problem
The problem is that git clone [...]
becomes gitclone [...]
.
Looking at the new code for SshExecutor.js
we find on lines 13 and 14,
const argsString = args?.join(' ') || ''
const sshCommand = command + argsString
which does not correctly set a space between the command and the first arg.
Proposed fix
I think this could be solved by changing line 13 to:
const argsString = args ? ' ' + args.join(' ') : ''
Testing this in a local Node.js v20.11.1
session:
function testFix(command, args) {
const argsString = args ? ' ' + args.join(' ') : ''
const sshCommand = command + argsString
// See what we end up with
console.log(sshCommand)
}
const command = 'git'
const args1 = ['clone', '--branch=main']
const args2 = undefined
// Now running the proposed expression of argsString towards both args1 and args2
testFix(command, args1)
testFix(command, args2)
Gives the output
git clone --branch=main
git
Testing if this solves deploying
I try implementing my fix into node_modules/@redwoodjs/cli/dist/commands/deploy/baremetal/SshExecutor.js
and run the deploy scripts, both verbose and non-verbose. For me, everything works.
...
async exec(path, command, args) {
//const argsString = args?.join(" ") || "";
const argsString = args ? ' ' + args.join(' ') : ''
const sshCommand = command + argsString;
...
Hope this is of help, and thank you for getting to this as quickly as you did! Let me know if you want me to test anything again.
from redwood.
Okay v7.6.2 is out with the further fix. Hopefully we didn't break it even more haha!
from redwood.
Fantastic! I've tested deploying on v7.6.2. Both verbose and non-verbose works like a charm!
from redwood.
Related Issues (20)
- [Bug?]: dbAuth handler resePasword does not validate password format as signup does HOT 4
- [RFC]: FieldError not being populated with server errors when inside Controller when using custom UI components HOT 5
- [Bug?]: graphiql authImpersonation breaking on windows HOT 3
- [Bug?]: Flight control deployment not working HOT 2
- [Bug?]: yarn scaffold script shows 404 when fetching packages HOT 9
- [Bug]: CLI commands fail due to unawaited promise (JS projects)
- [Bug?]: baremetal production HOT 5
- [Bug?]: MockGraphQLQuery not working when original query uses fragments HOT 10
- [Bug] Doubled up title when no explicit <title> set
- [Docs]: Outdated / incomplete doc regarding async directive testing HOT 3
- [Bug?]: Upgrading Redwood to Canary causes "unmountComponentAtNode is not a function" in Storybook
- [Bug?]: When using Trusted Documents and Auth, the Current User query is not permitted preventing authentication to work properly
- [Bug?]: `yarn rw dev` doesn't work because of fsevents dep HOT 3
- chore(deps): update dependency @supabase/supabase-js to v2.43.5
- [Bug?]: Can't configure Jest/Vitest to run tests inside of scripts dir
- [Bug?]: `web/src/auto-imports.d.ts` file generated after running `yarn rw storybook-vite` HOT 4
- [Bug?]: Pre-render does not work HOT 2
- [Bug?]: Flaky Testing with Prisma migrations failing HOT 5
- [Bug]: Docs search is broken HOT 3
- [Bug?]: yarn rw upgrade for 7.7.1 error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redwood.