theaccordance / balena-push

Continuously deploy your application to BalenaCloud
https://docs.mainwaring.dev/open-source-projects/balena-push
MIT License
20 stars 21 forks source link

Previously executing jobs suddenly don't run correctly #3

Closed amingilani closed 2 years ago

amingilani commented 4 years ago

Hi there

At first I thought it was my code, but now as it turns out it isn't. I reran a previously successful action and ran into this:

https://nodejs.org/en/download/
------------------------------------------------------------------------------
 _            _
| |__   __ _ | |  ____  _ __    __ _
| '_ \ / _` || | / __ \| '_ \  / _` |
| |_) | (_) || ||  ___/| | | || (_) |
|_.__/ \__,_||_| \____/|_| |_| \__,_|

Logging in to balena-cloud.com
Successfully logged in as: gh_amingilani

Find out about the available commands by running:

  $ balena help

If you need help, or just want to say hi, don't hesitate in reaching out
through our discussion and support forums at https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/
------------------------------------------------------------------------------
Warning: Node version "v8.14.0" does not match required versions ">=10.0.0".
This may cause unexpected behavior. To upgrade Node, visit:
https://nodejs.org/en/download/
------------------------------------------------------------------------------
Could not access source folder: "."

I did rename my repository in the middle, I don't know if that may have caused the issue, but I doubt that should. All new jobs that I now push are also broken.

amingilani commented 4 years ago

Oh, btw, here are my runs. It's a public repository.

theaccordance commented 4 years ago

Hey @amingilani, thanks for reporting the issue, I'll make some time this week to review in full and let you know if I need some more info

amingilani commented 4 years ago

Btw, I forked your repo and speed up the action's installation time down to a few seconds. Then I published my fork to learn how publishing actions work. If you'd like please take a look at my fork's Dockerfile and script. Feel free to merge the code back into your own repo if you'd like. They're minor changes.

Instead of downloading the CLI via NPM I download the latest version of the standalone CLI.

theaccordance commented 4 years ago

Btw, I forked your repo and speed up the action's installation time down to a few seconds.

I'm glad you could build upon my own learning experience like you have, and thank you for sharing some insights on improving the performance, since I'm diving into the repo today to troubleshoot your problem, I'll probably take the time to apply some of the insights you've shared & add some other improvements to the project.

Initial guess: It doesn't like my default value for application path since you're not including the value. I do recall that attribute being added towards the end of my initial work; my own implementation here actually wraps another repo for the continuous delivery, which is why I didn't design the action to automatically publish the root of the repo.

I do have a Balena POC that I haven't wired into CD yet, so I'll use that project to troubleshoot the default attribute further. In the mean time (and since you have your own published action), here are two options you can try to quickly unblock yourself:

Option 1: Add application-path definition to workflow file

In your workflow file, add a line specifying the application path to push. Since you just want to push the root of your repo, try ./ instead of just . which is the default. See my workflow file for an example

Option 2: Remove application-path from the entrypoint script

Since you're just looking to publish the root of your repo & you've already gone through the trouble of forking & publishing your own action, you could modify the entrypoint.sh file to remove the directory switch.

Instead of this line

cd ${GITHUB_WORKSPACE} && cd ${APPLICATION_PATH} && balena login --token ${API_TOKEN} && balena push ${APPLICATION_NAME}

You could modify yours to

cd ${GITHUB_WORKSPACE} && balena login --token ${API_TOKEN} && balena push ${APPLICATION_NAME}

If you go this route, just remember to clean up references to APPLICATION_PATH in the codebase so other's don't attempt to use your Action by specifying the a sub directory

Let me know if either of those work!

amingilani commented 4 years ago

Thank you for this insightful message, @theaccordance! So, a funny thing happened, and I that apologize I didn't report this earlier, but somehow switching myself to my own action unblocked me. I can't explain it yet, but since it worked, I didn't touch it.

I'll work through the steps you outlined, and report back soon. I'll also try forking my own repo and chasing this bug down so that we can both squash it. I think renaming my repository seemed to cause it, but since I'm on a deadline, I haven't been able to debug it yet.

Either way, thank you for your help, and I'll use your pointers to start on this in a day or so.

qvntra commented 4 years ago

@amingilani I am using your fork and it works perfectly. Was unable to get @theaccordance 's working.

theaccordance commented 2 years ago

@amingilani next time feel free to just open a PR with your fork. I've sync'd your changes with this repo and am marking this closed.