Skip to content

Commit

Permalink
Merge pull request #93 from VEAF/feature/44-switch-to-gitflow
Browse files Browse the repository at this point in the history
switch project to gitflow
  • Loading branch information
mitch10593 authored Feb 17, 2021
2 parents ff024be + 4ea964d commit e911c42
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ Accès par défaut:
cd website
./scripts/upgrade.sh
```

## Git flow

```shell
read VERSION
git checkout develop
git pull
git flow release start ${VERSION}
./scripts/changelog.sh ${VERSION}
git add .
git commit -m ${VERSION}
git flow release publish
git flow release finish

git push --tags
git push
git checkout master && git push
```
38 changes: 38 additions & 0 deletions scripts/dev/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e

# merge pending CHANGELOG files into final CHANGELOG.md file
# @param $1 release version (ex: 1.2.3)
VERSION=$1
if [[ -z "${VERSION}" ]]
then
echo "syntax: ./scripts/changelog.sh VERSION"
exit 1
fi

if [[ ! -f "CHANGELOG.md" ]]
then
echo "CHANGELOG.md not exists"
exit 2
fi

CHANGELOG_FILES=$(ls CHANGELOG?*.md)

echo "### ${VERSION}" > CHANGELOG.md.tmp

for entry in ${CHANGELOG_FILES}
do
# add a new line at the end of the file if it's not the case
sed -i -e '$a\' "${entry}"
echo "appending ${entry} to CHANGELOG.md"
cat "${entry}" >> CHANGELOG.md.tmp

done

echo "" > CHANGELOG.md.tmp
echo "keep original changes"
cat CHANGELOG.md >> CHANGELOG.md.tmp

echo "finalize CHANGELOG"
cat CHANGELOG.md.tmp > CHANGELOG.md
rm CHANGELOG?*.md CHANGELOG.md.tmp

0 comments on commit e911c42

Please sign in to comment.