Skip to content
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

Add Support for Rollbacks #2

Closed
banago opened this issue Feb 12, 2014 · 10 comments
Closed

Add Support for Rollbacks #2

banago opened this issue Feb 12, 2014 · 10 comments
Assignees
Labels

Comments

@banago
Copy link
Owner

banago commented Feb 12, 2014

Support for rollback to earlier version is being developed. You can view progress on the rollbacks branch.

It is expect to allow you to rollback to previous version by running:

phploy --rollback

Or to a more earlier version by running:

phploy --rollback revision-id

Suggestions are welcome.

@banago
Copy link
Owner Author

banago commented Feb 12, 2014

Hi @SimonEast,

If you reset your HEAD back and then ran the deploy again, is it possible for the script to detect the changes deploy the changed files (kind of in reverse?).

I'm thinking it would be better to let the script to do the checkout the the required commit and then push that commit, rather then do it manually. What do you think?

About the reset I don't know since it seem you loose history if you run it. I have to test this.

Please let me know.

@SimonEast
Copy link
Contributor

Yeah good point, it would be better to call --rollback with or without the
revision-id.

If you left out the revision-id, would it deploy the previous commit, or
the previous *deployed commit *(can the script determine which one that
was)?

Simon.

@banago
Copy link
Owner Author

banago commented Feb 13, 2014

@SimonEast to keep it simple and to the point, phploy --rollback without a revision id, will roll one step back current HEAD. And if you want to revert to another revision, you just provide the revision. I think this is the best approach, otherwise it becomes a little complicated to use.

@SimonEast
Copy link
Contributor

Yeah, sounds good. It's much easier to code that way. Just be clear in
the docs that that's how it works. :-)

@banago
Copy link
Owner Author

banago commented Feb 13, 2014

@SimonEast and @fadion - I think I've bumped into a Git bug. So, if I run the same command form the terminal and get a different result from the same one executed form PHP. The git command run in both cases is:

git diff --name-status HEAD^ ...revision-id

But results for deleted and added files are swapped. Check out the attached image. One says test.txt is added and the other was says it is deleted.

The command run through terminal returns the right results.

git-bug

Could you please pull the rollbacks branch and test on your environments please?

@banago
Copy link
Owner Author

banago commented Feb 13, 2014

Wow, one space makes a big difference in Git 😄

banago@work:knr-flatrock$ git diff --name-status HEAD^...c7b3a3e85dedb688fcb49750c5952636f2c80990
A       testing-deploy-again.txt
D       testing-deploy.txt
banago@work:knr-flatrock$ git diff --name-status HEAD^ ...c7b3a3e85dedb688fcb49750c5952636f2c80990
DDD     testing-deploy-again.txt
AAA     testing-deploy.txt

It's high time we get into Unit Testing @fadion - I'm growing white hair because of this kind of debugging. 😸

@fadion
Copy link
Contributor

fadion commented Feb 13, 2014

Just a space? Interesting...

@banago
Copy link
Owner Author

banago commented Feb 13, 2014

Yes sir - last thing I would think of...

@fadion
Copy link
Contributor

fadion commented Feb 13, 2014

When you're finished with the rollback featured, want me to make a "rewrite"? Mostly coding style (psr2 compliance), because it's a mix of styles, but some small things could be easily rewritten too. Nothing big anyway.

PS: Didn't want to open a new issue.

@banago
Copy link
Owner Author

banago commented Feb 13, 2014

Oh, yes please. I was thinking to ask you for a tool to help me with all the styling rules - not yet completely in my system :)

Go ahead and open an issue for that - it helps us to see what we are doing next.

@banago banago closed this as completed in f739f0d Feb 14, 2014
banago pushed a commit that referenced this issue Dec 7, 2016
banago pushed a commit that referenced this issue Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants