-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
dokku_clone
isn’t idempotent
#163
Comments
What version of the modules are you using? |
|
Looks like we try and get the commit sha but never compare it to what is being deployed: https://github.com/dokku/ansible-dokku/blob/master/library/dokku_clone.py#LL69C5-L69C12 Additionally - at least on my system - the sha is a short sha:
Would you be willing to contribute the fix to the ansible modules? |
Possibly, but I’m not sure how the various parts are supposed to work, e.g.:
|
In my example this is addressed by searching for the string |
A few answers:
The short sha being used is probably just because I didn't envision the use case of relying on that in other tooling. If you want to change it, the line upstream is here (I'd take a pull request ;) ). |
If you have more questions, feel free to catch me on the dokku discord/slack (I am |
Looks like it can now. |
What do you think about changing the interface to work like this?
|
First try at implementing dokku#163
@AndrewKvalheim I've implemented this change in this branch but haven't written any new test cases, so I'm not 100% sure about correctness. |
Added a simple test to Molecule that runs |
No longer necessary as of dokku/dokku#6776 |
Right, but |
[matching an abbreviated hash] is no longer necessary |
Description of problem
dokku_clone
always re-deploys the app even if the source hasn’t changed.Steps to Reproduce
Stabilize the example from the documentation by referencing a commit:
Run the task twice.
Actual Results
The task is imperative; the app is deployed twice.
Expected Results
The task is declarative; the app is deployed once.
Environment Information
dokku report inflector
outputAdditional information
Given Ansible’s convention of idempotence, I expected there to be some way to express the desired state, e.g. that the app be running from a specific source, and have the playbook make changes only as necessary to reach that state.
I’ve found that I can roughly accomplish this by comparing the Git revision of the source to that of the deployed app—
—but this feels unnecessarily convoluted for behavior that I initially expected to find in
ansible_dokku
or even Dokku itself.The text was updated successfully, but these errors were encountered: