doc(release): documente la release

pull/1/head
François Poulain 2021-06-23 16:17:59 +02:00
Parent 244fbb09f6
révision c0e49facb8
2 fichiers modifiés avec 97 ajouts et 0 suppressions

Voir le fichier

@ -95,6 +95,9 @@ install-deps: ## installe les dépendances de l'application
migrate: ## mets à jour le schéma de la base de données
$(PYTHON) manage.py migrate
check-migrations: ## teste la cohérence des migrations et du code
$(PYTHON) manage.py makemigrations --check --noinput --dry-run
static: ## collecte les fichiers statiques
ifeq ($(ENV), production)
@echo "Collecte des fichiers statiques..."
@ -148,3 +151,22 @@ ifeq ($(ENV), production)
else
$(PYTHON) manage.py shell_plus
endif
release: ### prépare une nouvelle version
ifdef VERSION
@echo Upgrading to version: $(VERSION)
@$(eval CURR_VERSION=$(shell python -c "import services_pour_tous; print(services_pour_tous.__version__)"))
@$(eval DATE=$(shell date -I))
@csplit --quiet --suppress-matched --prefix .CHANGELOG.md. CHANGELOG.md '/## \[Current development\]/1'
@echo "" >> .CHANGELOG.md.00
@/bin/echo -e '## [$(VERSION)] - $(DATE)\n' >> .CHANGELOG.md.00
@git log --pretty=format:'- %s' v$(CURR_VERSION)...HEAD >> .CHANGELOG.md.00
@echo "" >> .CHANGELOG.md.00
@cat .CHANGELOG.md.* > CHANGELOG.md
@sed -i -e "s/\(__version__ =\) '.\+'/\1 '$(VERSION)'/" services_pour_tous/__init__.py
@rm -f .CHANGELOG.md.*
else
@echo Usage:
@echo VERSION=x.y.z make release
@exit 1
endif

Voir le fichier

@ -184,6 +184,81 @@ In production, only the static files will be used. It is recommended to commit
the compiled assets just before a new release only. This will prevent to have a
growing repository due to the minified files.
## Release
Before releasing one should verify that `make test` and `make lint` are ok.
Migrations should also have been added during development process.
### Hygienic checklist
make test
make lint
npm run lint
make check-migrations
git grep '\<print\s*(\|pdb\>\|\<set_trace\>' '*.py'
### Release gitmnastic
0. Define variables
export VERSION="x.y.z" # version to be released
export ORIGIN="origin" # remote name for pushing my origin
export UPSTREAM="cliss21" # remote name for pushing upstream
export GITEA_USER="jdoe" # my forge username
1. Fork from the develop branch:
git checkout -b release_$VERSION
2. Build and commit statics
npm run build
git add -f services_pour_tous/static
git commit -m "build($VERSION): ajoute les statics compilés"
3. Update `services_pour_tous/__init__.py` and complete changelog via:
make release
4. Edit and commit it
/usr/bin/editor CHANGELOG.md
git add services_pour_tous/__init__.py CHANGELOG.md
git commit -m "doc(CHANGELOG): publie la v$VERSION"
5. Tag your release commit
git tag v$VERSION
6. Merge it in master
git push --set-upstream $ORIGIN release_$VERSION
git push --tags
# then open a PR via
xdg-open "https://forge.cliss21.org/cliss21/services_pour_tous/compare/master...$GITEA_USER:release_$VERSION"
# then get the PR merged
git push --tags $UPSTREAM
### That's released. Now we prepare repo for a new develop sprint
7. Rebase develop on master
git fetch --all
git checkout develop
git rebase $UPSTREAM/master
8. Revert statics from develop
git revert $(git rev-list --all --max-count=1 services_pour_tous/static/)
git push $ORIGIN
# then open a PR or not
xdg-open "https://forge.cliss21.org/cliss21/services_pour_tous/compare/develop...$GITEA_USER:develop"
# then get the PR merged (or directly push via git push $UPSTREAM)
9. You should be ready for a new develop sprint
git fetch --all
## License
Services pour tous is developed by Cliss XXI and licensed under the