I'm working on getting Spock working without errors.
So far it's partially working:
Remote Git Repository: Git Remote is hosted at BitBucket. If I login at BitBucket I can see that content updates are being pushed into the git repository by Spock along with their commit messages.
Spock.yaml: In my config I've got Spock doing git add, git commit
and then doin a git --rebase
, and finally a push back up to the remote repository. Following those, I've also got 2 rules to clear cache+stache.
[my spock.yaml]
commands_before:
- php please clear:cache
- git add -A
- git commit -m '{{ url }} updated by {{ committer:username }}'
- git pull --rebase origin master
- git push
- php please clear:cache
commands_after:
- php please clear:cache
- php please clear:stache
Problems I'm encountering:
1) User is logged out of CP whenever any content edits are made: The user is logged out of the Statamic control panel and isn't able to successfully log back into the cp until the cache has been manually cleared using the terminal and php please clear:cache
once that's done you can login. Until then, you'll just keep getting errors trying to login saying incorrect password, even though password is correct.
2) Statamic Log Error "Spock command exited unsuccessfully": If you look in the Statamic logs getting a log message for Spock that will say Spock command exited unsuccessfully
. Log level is shown as error
context is dev
. I'm not sure why it's showing exited unsuccessfully?
Example log message:
[2019-07-30 19:54:32] dev.ERROR: Spock command exited unsuccessfully:
Command: git -c "user.name=Spock" -c "[email protected]" commit -m "Globals saved by MyUsername"
Output:
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
Error: No error
3) Sometimes git commit messages display username and url sometimes not: Within BitBucket, sometimes the commit message has the author name info and url of what was edited, sometimes it just has the variable {{ url }} updated by {{ committer:username }}
Not sure why the inconsistency and where I'm going wrong with this one.
4) Redis: If I try and use Redis, I run into several additional errors on top of these. I'm not sure if these are related or not.
What I'm looking for:
I'm not sure where I'm going wrong, hoping someone who's got experience getting this working successfully can share some ideas.
1) I'm hoping to first sort out the Spock errors so that when I make a content edit the Statamic user isn't kicked out of the control panel.
2) Then I'd like to figure out why I'm seeing Spock saying exited unsuccessfully.
3) Once that's done, hoping to tackle getting Redis and Statamic working together.