daretodave / node-ytt

3 stars 0 forks source link

ytt repo has moved #2

Open scastria opened 4 months ago

scastria commented 4 months ago

install.js needs to be updated:

  1. Should point to carvel-dev/ytt instead of vmware-tanzu/carvel-ytt
  2. arm architecture should be arm64
daretodave commented 4 months ago

good call @scastria, i haven't touched this project in awhile

if you had any adjustments - i've made you collabrator. i will publish any changes

scastria commented 4 months ago

@daretodave Thanks. I made a PR. I assumed you wanted to review before merge and publish.

daretodave commented 4 months ago

Thanks, all looks well.

CI/CD publish failed but i will manually publish this later today to ensure the remote has a working fetch (then when i have time i will fix the ci/cd). Will update when this is published

scastria commented 4 months ago

Thanks!

scastria commented 4 months ago

@daretodave Have you had anytime to do a manual release? I am excited to try ytt inside a BitBucket plugin which is NPM based.

daretodave commented 4 months ago

@scastria apologies, the npm token used for this action was associated with defunct account. i have a support ticket with npm team to resolve this. ETA is tomorrow morning. will continue to keep you posted

scastria commented 4 months ago

Awesome! Thanks for your help.

daretodave commented 4 months ago

@scastria thanks for the assist and patience. this has been published with ci/cd (we fixed this as well as the token) - going forward, future merges to this project will result in a proper publish.

https://www.npmjs.com/package/node-ytt-cli

image

copy paste quick install @ working version -

npm i -g node-ytt-cli@0.0.50

note latest will also work

scastria commented 4 months ago

I am not that experienced with nodejs nor writing my own module. The new version works great when debugging locally, but not when running inside the forge runtime for BitBucket. I suspect there are some restrictions in the forge runtime that are causing problems. All that I get is:

exit code 1 | node_modules/node-ytt-cli/bin/ytt-cli --help

I notice in the ytt wrapper function that if an error is received, it aborts and throws an exit code. Is there anyway to provide more information upon error, like showing any stdout or stderr? Maybe that can help in debugging my forge issue.

Second question is: When does the install function in your wrapper get called? Is this a npm install hook that automatically gets called upon installing this package or do I have to call the install function from my code to actually install it?

scastria commented 4 months ago

I see the answer to my second question inside the package.json which lists a postinstall script which just runs the install.js file.

scastria commented 4 months ago

For my first question, I suspect the method forge uses to package up the forge app to upload to Bitbucket does not trigger the postinstall. I have tested modifying my forge JS code to manually download the ytt binary from github and then using the child_process module to execute that binary and that works. So it is possible for this node-ytt-cli module to be useful in more runtime/scenarios, maybe the install function should be exported so that it can be called directly by the user. And with the option to pass in a target directory of where to put the binary, like /tmp. And finally, for the install command to return early if the ytt binary is already downloaded allowing the install function to be called many times without redownloading the same file over and over.

daretodave commented 4 months ago

great suggestion @scastria. i will tend to this this weekend, apologies for the delay on that - got a couple of other hot items on my plate for another project

scastria commented 4 months ago

No hurry. I have a workaround currently. Thanks for the help.