Releasing

Releasing

Releasing

Preparation for release, on the local workstation

See release preparation. In short:

  • Set up gpg key for git to sign the release (see stackoverflow):
    gpg --list-keys
    git config user.signingkey XXXXXXXX

    (have to repeat for each repository, if patient-network, remote-matching, etc are in different repositories - or use
    git config --global user.signingkey XXXXX
  • Make sure you have your Nexus account configured in /.m2/settings.xml (put your own username and password in the file)

Performing the release, on the local workstation

cd patient-network

git checkout stable-1.2.x

git pull

echo release patient network ; export SNAPSHOT_VERSION=1.2-SNAPSHOT PROJECT=patient-network PT_VERSION=1.4.7 PN_VERSION=1.2.0 GPG_TTY=`tty` ; git clean -dxf ; mvn clean ; git checkout -b release-${PN_VERSION} ; sed -i -r -e "s/    <version>(.*)<\/version>/    <version>${PT_VERSION}<\/version>/" -e "s/<patientNetwork.version>(.*)<\/patientNetwork.version>/<patientNetwork.version>${PN_VERSION}<\/patientNetwork.version>/" -e "s/<remoteMatching.version>(.*)<\/remoteMatching.version>/<remoteMatching.version>${RM_VERSION}<\/remoteMatching.version>/" pom.xml ; git add pom.xml ; git commit -m '[release] Set the parent version to the right value' ; mvn release:prepare -DreleaseVersion=${PN_VERSION} -DdevelopmentVersion=${SNAPSHOT_VERSION} -Dtag=${PROJECT}-${PN_VERSION} && git checkout ${PROJECT}-${PN_VERSION} && git tag -d ${PROJECT}-${PN_VERSION} && git tag -s -m "Tagging ${PROJECT}-${PN_VERSION}" ${PROJECT}-${PN_VERSION} && git push -f origin ${PROJECT}-${PN_VERSION} && mvn release:perform && git checkout master && git branch -D release-${PN_VERSION}

cd ../remote-matching

git checkout stable-1.2.x

git pull

echo release remote matching ; export SNAPSHOT_VERSION=1.2-SNAPSHOT PROJECT=remote-matching PT_VERSION=1.4.7 PN_VERSION=1.2.0 GPG_TTY=`tty` RM_VERSION=1.2.0 ; git clean -dxf ; mvn clean ; git checkout -b release-${RM_VERSION} ; sed -i -r -e "s/    <version>(.*)<\/version>/    <version>${PT_VERSION}<\/version>/" -e "s/<patientNetwork.version>(.*)<\/patientNetwork.version>/<patientNetwork.version>${PN_VERSION}<\/patientNetwork.version>/" -e "s/<remoteMatching.version>(.*)<\/remoteMatching.version>/<remoteMatching.version>${RM_VERSION}<\/remoteMatching.version>/" pom.xml ; git add pom.xml ; git commit -m '[release] Set the parent version to the right value' ; mvn release:prepare -DreleaseVersion=${RM_VERSION} -DdevelopmentVersion=${SNAPSHOT_VERSION} -Dtag=${PROJECT}-${RM_VERSION} && git checkout ${PROJECT}-${RM_VERSION} && git tag -d ${PROJECT}-${RM_VERSION} && git tag -s -m "Tagging ${PROJECT}-${RM_VERSION}" ${PROJECT}-${RM_VERSION} && git push -f origin ${PROJECT}-${RM_VERSION} && mvn release:perform && git checkout master && git branch -D release-${RM_VERSION}

cd ../phenomecentral.org/


git checkout stable-1.2.x

git pull

echo release phenomecentral ; export SNAPSHOT_VERSION=1.2-SNAPSHOT PROJECT=phenomecentral PT_VERSION=1.4.7 PN_VERSION=1.2.0 GPG_TTY=`tty` RM_VERSION=1.2.0  PC_VERSION=1.2.0; git clean -dxf ; mvn clean ; git checkout -b release-${PC_VERSION} ; sed -i -r -e "s/    <version>(.*)<\/version>/    <version>${PT_VERSION}<\/version>/" -e "s/<patientNetwork.version>(.*)<\/patientNetwork.version>/<patientNetwork.version>${PN_VERSION}<\/patientNetwork.version>/" -e "s/<remoteMatching.version>(.*)<\/remoteMatching.version>/<remoteMatching.version>${RM_VERSION}<\/remoteMatching.version>/" pom.xml ; git add pom.xml ; git commit -m '[release] Set the parent version to the right value' ; mvn release:prepare -DreleaseVersion=${PC_VERSION} -DdevelopmentVersion=${SNAPSHOT_VERSION} -Dtag=${PROJECT}-${PC_VERSION} && git checkout ${PROJECT}-${PC_VERSION} && git tag -d ${PROJECT}-${PC_VERSION} && git tag -s -m "Tagging ${PROJECT}-${PC_VERSION}" ${PROJECT}-${PC_VERSION} && git push -f origin ${PROJECT}-${PC_VERSION} && mvn release:perform && git checkout master && git branch -D release-${PC_VERSION}

Re-releasing the same version

In case a mistake was made and a project needs to be re-relased, need to:

  • remove the release tags from the local repository: git tag --delete ${PROJECT}-${VERSION}, e.g. git tag --delete patient-network-1.2.0
  • remove tags from github: git push origin :${PROJECT}-${VERSION}, e.g. git push origin :patient-network-1.2.0
  • (likely not needed) roll back the branch from which a project should be released to the state of the branch on github (e.g. remove the two [maven-release-plugin] commits)
  • NEXUS should accept a new version of an artifact by default
  • repeat the release process as described above

Installing a newly released PC on preprod using data from prod2

On prod2

cd /var/lib/

mysqldump --events --single-transaction prod > prod.sql

tar -czf phenotips.tar.gz phenotips/

scp phenotips.tar.gz preprod:/var/lib/

scp prod.sql preprod:/var/lib/  (or scp via local workstation: "scp prod2.pc:/var/lib/prod.sql . ; scp prod.sql preprod.pc:/var/lib/")

rm phenotips.tar.gz prod.sql

On preprod

export BKNAME=`date +%Y%m%d`

cd /var/lib/

systemctl stop tomcat

mv /var/lib/phenotips/ /root/backups/phenotips-${BKNAME}

mysqldump --events --single-transaction prod > /root/backups/prod-${BKNAME}.sql

tar -xzf phenotips.tar.gz

mysql prod < prod.sql

rm phenotips.tar.gz prod.sql

yum update phenomecentral

systemctl start tomcat

star yum update phenomecentral will only work if the current version of PC on preprod is the same as the unzipped version of PC from the phenotips.tar.gz file. If the existing version is different, have to manually upgrade PC: replace all of /var/lib/phenotips/webapp with the exception of the 3 configuration files /var/lib/phenotips/webapp/WEB-INF/hibernate.cfg.xml, xwiki.cfg and xwiki.properties; those 3 files  may have to be merged manually.

star if the same version is re-installed, use yum reinstall phenomecentral instead of yum update. This will also re-fetch a new package in case the same version of PC was re-released.

Distribution Wizard

  • Some updated documents may be updated from a 2014 version to a 2013 version, or some other strange date(s). This is expected: as explained by Sergiu, when an XML is edited the "dateModified" field is often left "as is", resulting in a new doc having the date (according to XWiki) of the first version of the doc.
  • After the wizard is complete it will ask to DELETE UNUSED WIKI PAGES?. It is OK to delete all pages, except MMEStats and PCStats
  • Need to restart tomcat after wizard is done

Post install - after distribution wizard was run

  • After preprod is updated and restarted, check Administration->InstalledExtensions. Some may be "Installed but not valid". Need to take action on a case-by-case basis. As of 1.2, "Clinical Text Analysis" extension is known not to work, together with 4 dependencies it brings with it: "Jackson-dataformat", "Apache HttpClient Fluent API", "Apache Commons Logging" and "Core text analysis UI". All of them can/should be uninstalled for 1.2.
  • star when upgrading production 1.1.16 to 1.2, need to fix OwnerClass and CollaboratorClass classes. For that open OwnerClass as a class (and CollaboratorClass as a class) and for the owner field remove the first velocity snippet from the customDisplay section.
  • star when upgrading production 1.1.16 to 1.2, need to import all the contact info into the matching database using a python script. See PN-444. First need to generate the a JSOn from raw emails (parse_notification_history_script2.py ?), then import the resultig data into the DB (import_email2.py ?)

Reinstalling OS on a VM

virsh attach-disk prod1 /localhd/CentOS-7-x86_64-DVD-1611.iso hdb --config --type cdrom

mcedit /etc/httpd/conf.d/01-phenomecentral.org.conf -> look for the IP for the "ProxyPass /" near the end, and change it to the prod1 IP as listed by "ip address" on prod1.pc
service httpd reload

Availability

PhenoTips® is freely available under the terms of the the GNU Affero General Public License, version 3.0.

 Download the latest release
 Play with our demo
 Get the source code

Contact

 Ask for free support (by volunteers):
support@phenotips.org
 Inquire about commercial support:
info@gene42.com
 Follow us on twitter:
@phenotips

PhenoTips® is an exclusive trademark of Gene42 Inc.