Closed chriscroome closed 6 years ago
So, I tried this:
cd ~/sites/
git pull
Updating bca6e53..64ec67e
error: The following untracked working tree files would be overwritten by merge:
web/app/themes/coop-tech-oowp-theme/package-lock.json
Please move or remove them before you merge.
Aborting
mv web/app/themes/coop-tech-oowp-theme/package-lock.json ~/private/
git pull
warning: fetch updated the current branch head.
fast-forwarding your working tree from
commit bca6e53b1dea6a1f743ad97266a9de2d66f9cbf9.
error: Your local changes to the following files would be overwritten by merge:
README.md
docker-compose.yml
docker/assets/Dockerfile
web/app/themes/coop-tech-oowp-theme/assets/scss/app.scss
web/app/themes/coop-tech-oowp-theme/gulpfile.js
web/app/themes/coop-tech-oowp-theme/package.json
web/app/themes/coop-tech-oowp-theme/views/layout.php
Please commit your changes or stash them before you merge.
error: The following untracked working tree files would be overwritten by merge:
web/app/themes/coop-tech-oowp-theme/package-lock.json
Please move or remove them before you merge.
Aborting
fatal: Cannot fast-forward your working tree.
After making sure that you saved anything precious from
$ git diff bca6e53b1dea6a1f743ad97266a9de2d66f9cbf9
output, run
$ git reset --hard
to recover.
git stash
No local changes to save
git checkout dev
Already on 'dev'
Your branch is up-to-date with 'origin/dev'.
git pull
Already up-to-date.
bash ~/bin/update
No local changes to save
Already up-to-date.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
yarn install v1.5.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.69s.
[09:37:50] Using gulpfile ~/sites/web/app/themes/coop-tech-oowp-theme/gulpfile.js
[09:37:50] Starting 'copy'...
[09:37:50] Starting 'scripts:vendor'...
[09:37:50] Starting 'scripts:app'...
[09:37:50] Starting 'styles'...
[09:37:50] Finished 'scripts:app' after 177 ms
[09:38:04] Finished 'scripts:vendor' after 14 s
[09:38:04] Starting 'scripts'...
[09:38:04] Finished 'scripts' after 49 μs
[09:38:04] Finished 'styles' after 14 s
[09:38:04] Finished 'copy' after 14 s
[09:38:04] Starting 'default'...
[09:38:04] Finished 'default' after 9.19 μs
Success: WordPress database already at latest db version 38590.
And it now seems to be up and running OK:
Eyo @chriscroome, wanna distribute the load? Maybe add me for mail for the cron?
We should probably also think about limited accounts for SSHing in and dealing with this stuff?
Would also be nice to know when things deployed - I wouldn't be against a mail for that too ....
Hi @lwm sure, currently the site is set to only have SFTP access, see:
https://docs.webarch.net/wiki/SFTP
We could enable SSH access:
https://docs.webarch.net/wiki/SSH
This would disable SFTP access but I expect that isn't an issue for us.
If I run this will I get your current SSH keys?
su - cotechdev -s /bin/bash
ssh-import-id-gh lwm
That appears to have worked:
ssh-import-id-gh lwm
2018-03-31 09:55:10,633 INFO Authorized key ['4096', 'SHA256:zgvToMpoN0p6ApArD2QpJzYxeFagPTePp+R37xVKcrc', 'lwm@github/19097372', '(RSA)']
2018-03-31 09:55:10,634 INFO [1] SSH keys [Authorized]
I have switched the account over to enable SSH, try this:
ssh cotechdev@webarch1.co.uk
The site is in ~/sites/web
, add yourself to ~/.forward
if you wish to get emails, the only thing we haven't sorted is editing the crontab in the chroot -- I'm afraid I have to do that, however you can edit it in git:
https://git.coop/cotech/ansible/blob/master/roles/live2dev/tasks/main.yml#L29
And this is what we currently have:
#Ansible: Update code
* * * * * /home/cotechdev/bin/cron
#Ansible: Create tgz of uploads
01 09 * * * cd /home/cotechdev/sites/web ; tar -zcf cotech-images.tgz app/uploads/
Oh yes, done and done. Nice one. I'll ping on any crontab changes with a PR. Nice one!
The cron job to update the dev site is sending out this email every 5 minutes, I'll see what I can do to fix it…