UFP-UV Update Process

From UFP-UV Sakai Wiki

Jump to: navigation, search

Contents


Description

The update process consists on merging/applying changes and bugfixes to the existing build. The information on this page assumes that an UFP-UV build is already setup on the sakaitest.ufp.pt (10.11.4.14) machine, at the /servicos/sakai-build location.

Merging bugfixes/new features

The build source code is available at /servicos/sakai-build/src.


Changing Custom/In-house code

Custom/in-house code is typically available on the internal SVN server (svn://10.11.2.38/svn/sakai-ufp/contrib-ufp). The recommendation is to:

  • checkout an working-copy of the code
  • do custom changes
  • commit work
  • issue an svn up servicos/sakai-build/src/custom-module
  • compile & deploy using mvn -Pppa clean install sakai:deploy
  • start Pre-Production-a Tomcat to test changes
  • changes can always be reverted back to a previous revision


Changing Sakai code

Sakai code changes are applied from patches, which can be obtained using one of the following 3 methods:

Approach #1: From the JIRA issue page:

  • click on "Subversion Commits" tab
  • for each revision, click on the #revison number
  • for each changed file, click on the "Text changed" link
  • click on the "Patch link"

Approach #2: Using the "svn" command:

  • consult the revision list on the "Subversion Commits" tab of the JIRA issue page
  • for each revision, get patch: svn diff -c REVISION_NUMBER PATH_TO_SAKAI_SVN_MODULE > changes.patch

Approach #3: Using a script:
create-JIRA-patch.sh:

Usage:            create-JIRA-patch.sh [JIRA] [sakai_module]
 
Description:      Create a file named 'module_JIRA.patch' with the differences of JIRA affecting specified module.
 
Arguments:
   JIRA           Related Sakai JIRA (eg, SAK-12769).
   sakai_module   Sakai module (eg, assignment, calendar, ...).
  • cd /servicos/sakai-build
  • ./scripts/create-JIRA-patch.sh {SAK-XXXX} {SAKAIMODULE}
  • a new file will be created on the current directory: SAKAIMODULE_SAK-XXXX.patch
  • example: create-JIRA-patch.sh SAK-12345 user will create User_SAK-12345.patch



Applying changes

Once there's a "patch file" ready, this can be applied using the patch unix command. The code below exemplifies how to patch SAK-XXXX.patch to the Sakai user module:

  • cd /servicos/sakai-build/src/user
  • patch -p0 < SAK-XXXX.patch
  • compile & deploy using mvn -Pppa clean install sakai:deploy
  • start Pre-Production-a Tomcat to test changes
  • changes can always be reverted back to a previous revision



Building procedure

Building is done via a script which will compile, deploy and transfer build to production servers.

do-full-package.sh:

Usage:            do-full-package.sh  --full|--fast {-s} {-sb} {-y}
 
Description:      Compile, deploy and, optionally, transfer build file to production servers.
 
Arguments:
   --full         Do maven tests and a clean build.
   --fast         (Default) Skip maven tests, don't clean previous build, don't check for updates in external repos.
   -alt-src       Use alternate source folder (currently, alt-src/).
   -sb            Deploy only (use existing build).
   -st            Skip tests.
   -s             Do not print maven build information.
   -y             Non-interactive; do not ask for confirmations (assume yes).
   -no-transfer   Do not transfer builds to production servers.



Typical build command

Before starting, make sure all local tomcats are shut down. Pre-Production tomcats folders will be removed. The typical build procedure (outlined below) will perform a full build, skip tests (local builds with tests enabled are done when applying changes), deploy to full-builds/ folder and transfer build file to production servers (elearning.ufp.pt and elearning-b.ufp.pt):

  • cd /servicos/sakai-build
  • ./scripts/do-full-package.sh --full -st -y



Scheduling an update

On elearning.ufp.pt, schedule an update via crontab, setting the proper date:

  • vi /etc/crontab
  • edit: 32 05 11 09 * root /servicos/sakai-build/admin-scripts/ufpuv-update update
  • (the line above schedules an update to 5h32m of September, 11th)


On UFP-UV, schedule an warning message to be displayed to logged in users before the update:

  • Login as administrator on UFP-UV
  • Navigate to Administration Workspace > Maintenance
  • Add/edit an existing entry to match the date, and edit remaining fields as desired.
Personal tools