Closed Bandi017 closed 5 years ago
Hello there,
wordmove has no logging facilities; we manage all this sort of things - the domain of update data when deploying - through hooks, but the problem in your scenario is that you do not have curent wordmove's command at your disposal ... 🤔 but you have the push/pull action, the timestamp and the user. You just need to use some bash foo within hooks 😄
@Bandi017 i managed to get my own last command from my fish shell like this:
hooks:
pull:
before:
local:
- 'fish -c "history" | head -n 1'
With
hooks:
pull:
before:
local:
- 'fish -c "echo [(date)] User (whoami) just run command: (history | head -n 1)"'
I obtain this result:
2.4.1 ~/d/sshwordmove master 1
wordmove pull -u 3582ms
▬▬ Using Movefile: ./movefile.yml ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬ Running local hooks ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
local | Exec command: fish -c "echo [(date)] User (whoami) just run command: (history | head -n 1)"
local | Output: [Ven 12 Ott 2018 09:31:12 CEST] User fuzzy just run command: wordmove pull -u
✅ success |
Obviously I got it on STDOUT, but you can redirect >>
the output wherever you need
Oh last advise: if the command gets complicated, write a script, put it into a folder in the project (bin/
? scripts/
?) and call the script from the hook. You will thank yourself someday ;)
thanks :) i will give this a try pretty soon !
Hi there, i have a small question or probably new feature request, if possible.
Is there a way of logging wordmove activity ? i came across this situation : several people are working on a site...everyone has its virtual machine working and from time to time pushing small code changes to the live site.. i would like to have on the live site(or somewhere else ---even within an email ) a small log of the recent activity. Someone pulls or pushes i would like to know who has done so by using an id or name, a copy of the command, plus time stamp..; in order to have a better control over what is being done... of course we can organise and leave pushing to a single person but sometimes for smaller stuff it seems to be a waste of time waiting for that specific person :D