Operations grimoire/Login: Difference between revisions
From Nasqueron Agora
(Created page with "Login is handled by Auth Grove == Application information == * Repository: [https://devcentral.nasqueron.org/diffusion/GROVE/ rGROVE] * Maintainer: Dereckson * Written in PHP...") |
(Doc for deploy or upgrade) |
||
Line 6: | Line 6: | ||
* Written in PHP, use Laravel, Laravel Socialite and Keruald libraries | * Written in PHP, use Laravel, Laravel Socialite and Keruald libraries | ||
== Deployment information == | == Run it == | ||
=== Deployment information === | |||
* Deployed on [[Operations grimoire/Docker engine|Docker]] | * Deployed on [[Operations grimoire/Docker engine|Docker]] | ||
* Docker image: [https://devcentral.nasqueron.org/diffusion/DGROVE/ rDGROVE] | * Docker image: [https://devcentral.nasqueron.org/diffusion/DGROVE/ rDGROVE] | ||
* Needs MySQL, both for prod and on CI | * Needs MySQL, both for prod and on CI | ||
=== Start a new container === | |||
<code>run-login</code> | |||
=== Upgrade a live container === | |||
# Enter notifications container as app user : <code>docker exec -it --user=app login bash</code> | |||
# Check we're on the master branch and the history is clean | |||
# Update code rebasing the production branch against origin/master | |||
# If composer has been touched, <code>composer update</code> (could be faster to docker pull, stop this container and start a new container) | |||
# To upgrade database schema, <code>php artisan migrate</code> | |||
# If entered as root, fix ownership with <code>chown -R app:app /var/wwwroot/default</code> | |||
# Restart PHP FPM with <code>sv restart php-fpm</code> | |||
# Run <code>php optimize</code> to refresh compiled class | |||
# Restart again PHP FPM with <code>sv restart php-fpm</code> | |||
For longer upgrade, you can put the application in maintenance mode with <code>php artisan down</code>. | |||
If preferences are updated (in the code or by us), update the cache: <code>php artisan config:cache && sv restart php-fpm</code> is needed. | |||
=== How to rebase against master? === | |||
# update master to match origin/master | |||
# rebase production against master | |||
<syntaxhighlight lang="console"> | |||
$ git fetch | |||
$ git checkout master | |||
$ git rebase origin/master | |||
$ git checkout production | |||
$ git rebase master | |||
</syntaxhighlight> | |||
If there is a merge conflict: | |||
# Edit the conflict files | |||
# <code>git add <edited files></code> | |||
# <code>git rebase --continue</code> | |||
== Troubleshooting == | == Troubleshooting == |
Revision as of 12:51, 25 August 2016
Login is handled by Auth Grove
Application information
- Repository: rGROVE
- Maintainer: Dereckson
- Written in PHP, use Laravel, Laravel Socialite and Keruald libraries
Run it
Deployment information
Start a new container
run-login
Upgrade a live container
- Enter notifications container as app user :
docker exec -it --user=app login bash
- Check we're on the master branch and the history is clean
- Update code rebasing the production branch against origin/master
- If composer has been touched,
composer update
(could be faster to docker pull, stop this container and start a new container) - To upgrade database schema,
php artisan migrate
- If entered as root, fix ownership with
chown -R app:app /var/wwwroot/default
- Restart PHP FPM with
sv restart php-fpm
- Run
php optimize
to refresh compiled class - Restart again PHP FPM with
sv restart php-fpm
For longer upgrade, you can put the application in maintenance mode with php artisan down
.
If preferences are updated (in the code or by us), update the cache: php artisan config:cache && sv restart php-fpm
is needed.
How to rebase against master?
- update master to match origin/master
- rebase production against master
$ git fetch
$ git checkout master
$ git rebase origin/master
$ git checkout production
$ git rebase master
If there is a merge conflict:
- Edit the conflict files
git add <edited files>
git rebase --continue
Troubleshooting
URL issue
If URL are in http://localhost, ensure the web server passes proxy forwarding information (include proxy_params in nginx), as the application guess links.
Configuration as code.
This service should be properly defined in rOPS repository as a Salt state.