Fundraising tech/Deployment

Release tags and branches
Please note that many repositories include checked-in external libraries. This should only be done on the deployment branches, the master branch is rebuilt by the developer. Do check in composer.lock and similar files for version locking.

Deployment process
Fundraising cluster deployment is always done from frpm1001. Software is deployed using the custom fundraising_code_update and rsync_blaster scripts, configuration is deployed with frpm1001 as the puppetmaster. More information is available about deployment on Collab.

Our deployment scripts simply pull down specific branches from gerrit and rsync them to our production servers. We never run composer nor any minification scripts in production. This means that we need to check in all our dependencies to our repositories, generally in a /vendor submodule under the repo with the dependencies.

For payments-wiki, we deploy the fundraising/REL1_35 branch (updated every two years to track the LTS branch of Mediawiki) of mediawiki/core, as well as the fundraising/REL1_35 branch of mediawiki/core/vendor. Our branch of mediawiki/core/vendor includes dependencies for Mediawiki core and our deployed extensions but no dev-dependencies. We do not deploy additional vendor subdirectories under each extension, as we make use of the composer-merge plugin to install all dependencies to the top-level vendor directory.

We generally update mediawiki/core/vendor one library at a time. For example, if we have tagged an updated version of SmashPig, the procedure to update vendor is as follows:

Configuration
Change paymentswiki configuration files on the frack puppetmaster, frpm1001. Check out the settings repo (into your homedir on frpm, not your dev machine). developer@frpm1001:~$ git clone /var/lib/git/localsettings.git Then inside the copy in your homedir, make changes and push to the shared repo. After pushing to the shared repo, you can ask another fr-tech member to review the change if there's anything tricksy. Then deploy the change using fundraising_code_update and rsync_blaster, targeting whichever project pertains to the config file you have just changed.

fr-tech doesn't have access to configure some subsystems directly - any settings outside of the /srv directory are managed by fr-tech-ops via puppet. You can clone the puppet repo down to your frpm homedir as well but you will have to ask an fr-tech-ops member to actually apply any changes.

Matching gifts employers list
The csv containing employer names and their Civi IDs is deployed alongside the LocalSettings.php configuration file for payments-wiki. You need to copy it from the civi box to the frpm box.

On frpm you can copy a script to update it from the local scripts repo in /var/lib/git.

git clone /var/lib/git/tools.git/ bin

When you run this script, you will need to be ssh'ed into the puppetmaster with agent forwarding (ssh -A frpm) so that your user on frpm can access files on the civi box. Run ~/bin/updateemployer.sh from your local copy of the localsettings git repo. It will
 * copy the file from where it is generated on Civi to payments-wiki/employers.csv
 * commit it to git
 * run fundraising_code_update and rsync_blaster for payments-wiki

SmashPig
There are three ways to deploy SmashPig, standalone, in civicrm, and in DonationInterface.

Deploying Standalone

Both the Civicrm and DonationInterface use SmashPig packagist repository.

 Updating the Composer Package

1. Checkout master in your local copy of the SmashPig repo
 * We distribute SmashPig as a composer package wikimedia/smash-pig, managed at
 * Version numbers are controlled by git tags using the semantic versioning numbering scheme.
 * To bump the package version from e.g. 0.5.9 to 0.5.10:

2. Update the git tag

3. Go to

4. Click the green 'Update' button

Deploying in Civicrm

Deploying SmashPig as a composer dep of CRM is very involved. Replace v0.5.11.3 with the next logical version number after the current one, trying to stick to the rules at https://semver.org/ (breaking changes increase the 1st digit, minor changes increase the second digit, bugfixes increase the 3rd digit).

Deploying in DonationInterface
 * commit SmashPig/master
 * git tag v0.5.11.3 HEAD
 * git push origin v0.5.11.3
 * update SmashPig on packagist.org
 * in crm/master, composer update wikimedia/smash-pig
 * if composer doesn't see the new version, try composer clear-cache
 * commit crm/master
 * check out crm/deployment
 * merge crm/master
 * rm -rf vendor # to get rid of dev dependencies
 * git submodule update --init # to get a copy of vendor identical to the repo
 * composer install --no-dev
 * cd vendor
 * git add . && git commit
 * git review and merge to master in the vendor repo
 * update submodule ref for vendor in crm/deployment
 * commit crm/deployment (git commit --amend to squash it in with the merge commit)

After updating the composer package you need to update the vendor directory and the lock file for payments wiki.

Update the vendor directory with the latest changes on mediawiki/vendor

1. Delete the vendor directory

2. Update the submodules

3. Update composer

Below steps need confirmation

4. Go into /vendor (what would the path be here and branch that its on)

5. Then in mediawiki/core:

update the vendor directory

update the lock file

CentralNotice
Please see CentralNotice documentation on Wikitech.