Deployment¶
- Table of contents
- Deployment
Introduction¶
- Automated deployment is enabled by custom build system based on BuildBot (documentation).
- Build system is hosted at dedicated virtual server called alchemist.
- The web interface for build monitoring is accessible at https://alchemist.cesnet.cz/buildbot/. Security is provided by selective shibboleth authentication. Note, that when Shibboleth session expires the whole application is defunct and you have to refresh the page.
- There is a simple web application running at https://alchemist.cesnet.cz/, which provides access to project artifacts (auto-generated documentation, packages, etc.).
Versioning¶
Our final aim is to obey semantic versioning, however we still have to decide what are user facing changes (are our users Mentat admins, or their users?).
For now common sense rules are:- major version changes when all hell breaks loose (example: Perl -> Python, Mongo -> PSQL)
- minor version changes on new feature set or substantial set of fixes
- patch version changes
- release and master branch - on set of new bugfixes, use only numbers <99 (including zero). We can (and sometimes must) cherrypick here from devel.
- devel branch - whenever suitable for new build, use only numbers >= 100, thus new major version can naturally follow as merge from devel branch. Also note that devel numbering is opaque to users, who do not see it unless inquisitive and determined (... ok, or just look into repo), and rule can be changed in the future if deemed necessary.
Package deployment¶
Setup¶
You have to setup following remote repository to work with automated build system:
git remote add buildbot mentat@alchemist.cesnet.cz:/var/projects/mentat/repo.git
Deploying development packages¶
Automated build system is monitoring the devel branch on alchemist.cesnet.cz
server to build development packages. Anything pushed into that branch will trigger the build. The build is as simple as executing following command:
# For the first time: git push buildbot devel # When remote branch tracking is set: git push buildbot
Deploying release packages¶
Automated build system is monitoring the release branch on alchemist.cesnet.cz
server to build release packages. Anything pushed into that branch will trigger the build. The build is as simple as executing following command:
# For the first time: git push buildbot release # When remote branch tracking is set: git push buildbot
Deploying production packages¶
Automated build system is monitoring the master branch on alchemist.cesnet.cz
server to build production packages. Anything pushed into that branch will trigger the build. The build is as simple as executing following command:
# For the first time: git push buildbot master # When remote branch tracking is set: git push buildbot
Deployment workflow¶
Prior to the deployment change to the devel branch and update release version in following files to appropriate value (for example 2.2.0
):
lib/mentat/__init__.py
You are now set to start the deployment.
- Deployment process usually starts at devel branch. You should build packages and install it on mentat-alt server for verification. When installing please proceed according to the documentation.
git checkout devel git add lib/mentat/__init__.py git commit #---- DEPLOY: Version bumped up to '2.2.0' to build new distribution. (Redmine issue: #3387) #---- git push origin devel git push buildbot devel
- When everything seems in order merge devel branch into release branch, build packages and install it on our mentat-hub server for verification. When installing please proceed according to the documentation.
git checkout release git merge devel git push origin release git push buildbot release
- When everything seems in order merge release branch into master branch, build packages. This is a final public release.
git checkout master git merge release git push origin master git push buildbot master
- Package is now live in repository. You should now create annotated tag with descriptions of all new major features and changes.
# DO NOT FORGET TO SWITCH BACK TO DEVEL git checkout devel # Take inspiration in previous annotated tags: git tag -l -n999 # Create new anotated tag: git tag -a v2.2.0 #Second round of improvements in 2.x series # #Extensive release description... # #Full list of resolved issues can be found in our ticket tracking system: # # https://homeproj.cesnet.cz/versions/82 # # In case you made a mistake you can delete the tags with following commands: git tag -d v2.2.0 git push --delete origin v2.2.0 git push --delete buildbot v2.2.0 # Push tags to servers git push origin v2.2.0 git push buildbot v2.2.0
- Close the finished version in Homeproj at https://homeproj.cesnet.cz/projects/mentat/settings/versions
- Now update banner on https://homeproj.cesnet.cz/projects/mentat/banner to inform users about new release.
- Finally write news to https://mentat.cesnet.cz/en/news page about the new release. If you think ahead you may reuse the text from your annotated tag above. Use following commands to attach some release statistics as well.
# Number of commits between last two versions: git rev-list --count v2.1.0..v2.2.0 # Total changes between last two versions: git log --numstat --pretty="%H" v2.2.0..v2.3.0 | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'