Update README
Document deployment
This commit is contained in:
parent
e117a20e03
commit
b474ffd243
27
README.md
27
README.md
@ -2,6 +2,33 @@
|
||||
|
||||
La dernière version stable est accessible à cette adresse : https://www.gnous.fr
|
||||
|
||||
## Déploiement
|
||||
|
||||
Ce site est déployé au moyen d'un tour de passe-passe qui combine git et Docker.
|
||||
|
||||
Un [hook post-receive](https://git-scm.com/docs/githooks#post-receive) (voir ci-dessous) permet d'automatiquement mettre à jour le dépôt git servant les sources à chaque événement de poussée concernant la branche `master`.
|
||||
Pour plus de simplicité, le dépôt est monté dans le conteneur applicatif de g² (Gitea).
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
TARGET="/var/lib/apache"
|
||||
REMOTE="local"
|
||||
|
||||
while read oldrev newrev ref
|
||||
do
|
||||
# only checking out the master (or whatever branch you would like to deploy)
|
||||
if [ "$ref" = "refs/heads/master" ];
|
||||
then
|
||||
echo "Ref $ref received. Deploying master branch to production..."
|
||||
cd $TARGET
|
||||
unset GIT_DIR
|
||||
git pull --ff-only $REMOTE master
|
||||
else
|
||||
echo "Ref $ref received. Doing nothing: only the master branch may be deployed on this server."
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Une version de test tourne peut-être [ici](https://www.test.gnous.fr).
|
||||
|
Loading…
Reference in New Issue
Block a user