-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.2.x] Running octodns-sync twice in one job fails #57
Comments
I see it! On the first run I had octodns-sync/scripts/install.sh Lines 6 to 18 in 7fa64b6
For the next test I made A proper solution should account for this scenario as well: # Run octodns to test the first time, with a branch name
- name: Test current configuration
id: octodns-test
uses: solvaholic/octodns-sync@7fa64b6
with:
octodns_ref: master
# Test again in the same job, with a version tag
- name: Test current configuration again
id: octodns-test2
uses: solvaholic/octodns-sync@7fa64b6
with:
octodns_ref: v0.9.12
# Test again in the same job, with a different branch name
- name: Test current configuration again again
id: octodns-test3
uses: solvaholic/octodns-sync@7fa64b6
with:
octodns_ref: super-feature
# Test again in the same job, with a different version tag
- name: Test current configuration again again again
id: octodns-test4
uses: solvaholic/octodns-sync@7fa64b6
with:
octodns_ref: v0.9.11 It may suffice to I'd like that ( |
to specify octodns_ref: master Testing for solvaholic/octodns-sync#57
I set up a workflow for testing and demonstrated this error: I'll check |
and exit early if octodns-sync is already installed. See #57
a3a3885 and subsequent commits handle this issue ( |
While the current solution is, I guess, a solution to the problem, it's not the solution I want. What I want is for solvaholic/octodns-sync to give you a way to run multiple times in one job, with different or same configurations. Why, though? Like, apart from the fact I think it should work I'm not thinking of the use case. If you have one, I'd like to hear about it. Please re-open this issue or open a new one and let's discuss it. In the meantime I added the In case the changes I made today broke something for you, please let me know about that too. If need be we can revert them to: octodns-sync/scripts/install.sh Lines 1 to 18 in 7fa64b6
|
Hi there. Thanks for the work on this awesome action! I'd like to run the action 2x in the same job for the use case you described: deploying public and private DNS which have different config files. Yes it can be done in another job but in my opinion it's not worth the overhead of spinning up a new container. What if install.sh outputs an environment variable or file to indicate that it's been run already and then have a check at the beginning which simply quits (with exit code 0 so it doesn't halt the workflow) if it's not the first run? |
Hi @travislikestocode 👋 You're welcome! And thank you for bringing this up 🙇
I dig it. That way if octodns-sync is already available the action skips the install and moves on. In my imagination there were workflow job step configuration details to reconcile, on re-run. For example, what if in step 1 Looking at the action's inputs now, though, I think
Would it meet your needs to run the action 2x, with effectively the same |
@solvaholic ah good catch. It's fine for me not to handle the case where a different ref is used since I'm using the same version for both sync runs. I did this for my own fork to get things working. I'll submit a PR. For the record it is also necessary to delete the plan file from an earlier run, on subsequent runs. |
Yikes! I think it'll help for the Action to pass the plan output as an output. On subsequent runs, it's ok to just delete the previous plan and log files, right? Unless we find a reason to preserve (and rotate?) them, I'd be ok to just Lines 8 to 9 in 92eadc9
|
Works for me!
Sounds good. I did that but also added the output you suggested so we should be good Created #66 for this |
Thank you @travislikestocode 🙇 I'll check out this and #67 and follow up quick as I can, it may be a few days tho (family and work schedules are dicey just now). At the latest, I'll follow up on Mon 05 Jul. |
My pleasure!
Sweet, no rush! Take your time :) |
#66 has been merged, which fixes this in |
ℹ️ This issue does not affect solvaholic/octodns-sync@v2.1.x ℹ️
Description
Running octodns-sync (this Action) multiple times in one job fails when
scripts/install.sh
tries to clone octodns/octodns again to an existingoctodns-src
directory.Expected Behavior
Multiple runs of octodns-sync in one job should not block each other. For example, you may have a
public.yaml
and aprivate.yaml
and want to test both in one job.Actual Behavior
The first time I tried it, both runs seemed to succeed OK 🤷
The next time, the first step succeeded and the repeat step failed because Git refused to re-use the
octodns-src
directory.Possible Fix
Teach
scripts/install.sh
to recognize and use an existing clone.Steps to Reproduce
Context
Your Environment
The text was updated successfully, but these errors were encountered: