This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. CKG Edit ====== Release a hotfix ====== In this tutorial we will describe how to release a hotfix. ===== 01 - Prerequisites ===== * We need clone of git [[https://github.com/bcvsolutions/CzechIdMng|repository]] with checkout actual branch with hotfix, during the process, we will need the **right to write** to this repository, example: # clone respository $ git clone git@github.com:bcvsolutions/CzechIdMng.git # change folder $ cd CzechIdMng # checkouthotfix $ git checkout hotfix/<HOTFIX_VERSION> * install maven to your computer ([[https://maven.apache.org/install.html|maven install steps]]), ==== Hotfix branch not exists ==== If branch with hotfix doesn't exists, you can easily create this branch with this command (you must be on branch **master** and locally or remote must not exist branch with name hotfix...): $ cd Realization/backend/aggregator/ $ mvn clean -Prelease jgitflow:hotfix-start $ git push -u origin hotfix/<HOTFIX_VERSION>:hotfix/<HOTFIX_VERSION> This commands creates new hotfix started from **master** branch. Sometimes is needed to fix previously released version. For this case, we can find last commit id (= last commit in tag) and start hotfix with command: $ mvn clean -Prelease jgitflow:hotfix-start -DstartCommit=<CHANGE_WITH_COMMIT_ID> -DreleaseVersion=<CHANGE_WITH_CURRENT_HOTFIX_VERSION_WITHOUT_SNAPSHOT_SUFFIX> === Manually clean/fetch local branches === Execute this three commands in CzechIdm folder. $ git fetch -p $ git branch -vv $ git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done This command create new branch and set up new version in BE poms. //FE package.json// you must update by self. ===== 02 - Maven settings ===== After install maven is necessary setup maven via **settings.xml**, this file you can found in **~/.m2./**. If this file don't exists create it. Into file you must put this settings (change username and password yours!): <code xml> <settings> <servers> <!-- Nexus server login information --> <server> <id>nexus</id> <username><USERNAME></username> <password><PASSWORD></password> </server> </servers> <pluginGroups> <pluginGroup>external.atlassian.jgitflow</pluginGroup> </pluginGroups> <mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>https://nexus.bcvsolutions.eu/repository/maven-public/</url> </mirror> </mirrors> <profiles> <profile> <id>nexus-repo</id> <repositories> <repository> <id>maven-snapshots</id> <url>https://nexus.bcvsolutions.eu/repository/maven-snapshots/</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>maven-release</id> <url>https://nexus.bcvsolutions.eu/repository/maven-releases/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>nexus-repo</activeProfile> </activeProfiles> </settings> </code> ===== 03 - Update FE package.json with actual version ===== * Update version in FE package.json **is not** automatically. You must update this information by self [[https://github.com/bcvsolutions/CzechIdMng/commit/7b702e8aa5c814b1cf6c40cae67a64b77e2f80d0|example]]. This changes you must commit and push before start with release. ===== 04 - Release via aggregator ===== Follow the following commands: # in your local clone of repository go to $ cd CzechIdMng/Realization/backend/aggregator # start with release hotfix $ mvn clean -Prelease jgitflow:hotfix-finish -DupdateDependencies=false -DdocumentationOnly=true -DallowUntracked=true -DdevelopmentVersion=<CHANGE_WITH_CURRENT_DEVELOPMENT_BRANCH> <note tip>If you have access to GitHub via username and password (not ssh key), you will be ask for this information during the release</note> If you get during process this error: ''The authenticity of host 'git.bcvsolutions.eu' can't be established.'' add into parameters this: $ mvn ... -DenableSshAgent=true If you have untracked files which will definitely not cause GIT conflicts, add the following parameter: $ mvn ... -DallowUntracked=true * After mvn finish with build, test and update just enter this on hotfix branch: $ git push $ git push --tags <note important>If hotfix is started from master branch, don't forget to merge your branch (= latest release) into master. </note> <note important>If hotfix is not started from master branch, then after finish with hotfix, merge hotfix branch in develop only, **not to master**. Sometimes is development version to different and automatic merge fails anyway. If old version is hotfixed, then most probably hotfix-finish command fails, after artifacts are deployed to nexus and when master branch is updated - **this is ok** - we don't want to merge "old" version into master. Just ignore changes on master branch, create tag on hotfix branch manually (e.g. directly from github) a merge hotfix branch into develop manually. After merge, you can delete hotfix branch.</note> <note tip>After success release don't forget to delete hotfix branch.</note> by tomiskar Log In