Developer Area/Language Packs/Launchpad Branching: Difference between revisions
From Mahara Wiki
< Developer Area | Language Packs
No edit summary |
|||
Line 9: | Line 9: | ||
= 0. Initial setup = | = 0. Initial setup = | ||
If you haven't used the Mahara Bazaar repo before, you'll need to do some setup. (These instructions are taken from the [http://doc.bazaar.canonical.com/bzr.2.6/en/mini-tutorial/index.html#introducing-yourself Bazaar manual]). First, install the Bazaar command-line tools. | If you haven't used the Mahara Bazaar repo before, you'll need to do some setup. (These instructions are taken from the [http://doc.bazaar.canonical.com/bzr.2.6/en/mini-tutorial/index.html#introducing-yourself Bazaar manual]). First, install the Bazaar command-line tools, and the Debian package maintainer utilities. | ||
sudo apt-get install bzr | sudo apt-get install bzr devscripts | ||
Then, upload your public SSH key into Launchpad, using the Launchpad website: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair | Then, upload your public SSH key into Launchpad, using the Launchpad website: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair | ||
Line 85: | Line 85: | ||
Once the scripts are committed, deploy the scripts by generating a new custom-site-mahara-langpacks debian package. | Once the scripts are committed, deploy the scripts by generating a new custom-site-mahara-langpacks debian package. | ||
cd path/to/mahara-scripts | cd path/to/mahara-scripts | ||
dch -i --no-auto-mu # And then update the changelog to indicate what you're doing, e.g. "16.04 release" | |||
fakeroot debian/rules binary | fakeroot debian/rules binary | ||
git add debian/changelog | |||
git commit -m "16.04 release" | |||
git push | |||
If done correctly, this will generate a file called "custom-site-mahara-langpacks_X.YY_all.deb". If you get a strange version number with something like "-ubuntu" or "-nmu1" on the end, then remove your local changes and try manually specifying the incremented version with "dch -v 1.29", or just edit the debian/changelog file by hand. | |||
The resulting .deb will need to need to be installed | The resulting .deb will need to need to be installed on the Catalyst servers where langpacks.mahara.org are installed. You may ask the Catalyst Sysadmins to deploy it by creating a WR and attaching the .deb file. They will upload it to the correct internal repository and deploy it. | ||
You may ask |
Revision as of 14:01, 11 April 2016
A word about Bazaar
Because the translation is managed through Launchpad, it's handled by the Bazaar version control system instead of Git. Bazaar has similar functionality to git, but its organizational system is very different. Unlike Git and CVS, in which branches and tags are a kind of "parallel dimension" to the repository's directory structure, Bazaar is more like Subversion, where branches and tags are addressed as directories.
Bazaar (at least the distribution on Ubuntu) also incorporates several Launchpad-specific shortcuts. For instance, prefacing a location with "lp:" is shorthand for the Launchpad Bazaar repository: bzr+ssh://bazaar.launchpad.net/+branch/mahara-lang/mahara. When we create new branches, they're referred to starting with "lp:~mahara-lang/mahara-lang", which means they're owned by the "mahara-lang" group, and placed under their "mahara-lang" directory (named after the "mahara-lang" project). Once we associate a particular branch with the mahara-lang project officially through Launchpad, the address shortens to "lp:mahara-lang/...".
As long as you're not trying to do anything too new and different, the code here should be enough to get you through.
0. Initial setup
If you haven't used the Mahara Bazaar repo before, you'll need to do some setup. (These instructions are taken from the Bazaar manual). First, install the Bazaar command-line tools, and the Debian package maintainer utilities.
sudo apt-get install bzr devscripts
Then, upload your public SSH key into Launchpad, using the Launchpad website: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
Once you've done that, you can set up your bzr credentials on your computer. These are stored at the user level.
bzr whoami "FIRSTNAME LASTNAME <[email protected]>" bzr launchpad-login YOUR_LAUNCHPAD_USERNAME
Create a new code branch
Create a new code branch in the mahara-lang launchpad project for importing pot templates. This should contain a copy of the latest mahara/mahara.pot from master.
First, get the latest code from master...
cd ~/bazaar # Or wherever you want to store your bazaar branches # There's probably a better way to keep your master checkout in sync, # But I find it's just easiest to delete it and do a new checkout rm -Rf trunk bzr checkout lp:mahara-lang ./trunk # get a copy of the mahara-lang trunk
Then, create the new code branch, copy the master code into it, and publish it to Launchpad.
cd ~/bazaar mkdir 16.10_STABLE cd 16.10_STABLE bzr init mkdir mahara # Copy the mahara.pot from the trunk cp ~/bazaar/trunk/mahara/mahara.pot mahara/ bzr add mahara/mahara.pot bzr commit bzr push lp:~mahara-lang/mahara-lang/16.10_STABLE
Create the new export branch
You'll also need to manually create a new export branch, which can be mostly empty. (Launchpad will fill it with content.)
cd ~/bazaar mkdir 16.10_STABLE-export cd 16.10_STABLE-export bzr init mkdir mahara bzr add mahara bzr commit bzr push lp:~mahara-lang/mahara-lang/16.10_STABLE-export
Create a new series
Check that the two branches have appeared under https://code.launchpad.net/mahara-lang. The code branch should contain the mahara.pot file.
Create the new series under the mahara-lang project on launchpad at https://launchpad.net/mahara-lang/+addseries
You should set the official series branch to the one you just created (~mahara-lang/mahara-lang/1.5_STABLE). Once that's done, launchpad calls the branch by the abbreviated name lp:mahara-lang/1.5
Set up translation import and export for the new series
In the translation synchronisation settings for the 1.5 series (https://translations.launchpad.net/mahara-lang/1.5/+translations-settings), set the translation to "Import template files" from the official branch (on the trunk series, we "Import template and translation files", but it can potentially overwrite translations, so we don't do that for a stable branch).
In the export synchronisation settings, export translations for the series to the new export branch (lp:~mahara-lang/mahara-lang/1.5_STABLE-export). This should be automatically populated in a day or so, once there are translations to export. This is the branch where the langpacks.mahara.org tarballs come from.
Update the scripts
Update the langpack scripts. In the mahara-scripts repo, there are two files that need to be updated with the new branch name:
mahara-langpacks/langpacks.pl (which generates langpack tarballs from lp:~mahara-lang/mahara-lang/1.5_STABLE-export)
mahara-langpacks/update-pot.sh (which pushes new changes to English strings to lp:mahara-lang/1.5 to be translated)
Just edit these files, look for the other branch names, and add 1.5_STABLE. You should also remove the old no-longer-supported branches at the same time.
Once the scripts are committed, deploy the scripts by generating a new custom-site-mahara-langpacks debian package.
cd path/to/mahara-scripts dch -i --no-auto-mu # And then update the changelog to indicate what you're doing, e.g. "16.04 release" fakeroot debian/rules binary git add debian/changelog git commit -m "16.04 release" git push
If done correctly, this will generate a file called "custom-site-mahara-langpacks_X.YY_all.deb". If you get a strange version number with something like "-ubuntu" or "-nmu1" on the end, then remove your local changes and try manually specifying the incremented version with "dch -v 1.29", or just edit the debian/changelog file by hand.
The resulting .deb will need to need to be installed on the Catalyst servers where langpacks.mahara.org are installed. You may ask the Catalyst Sysadmins to deploy it by creating a WR and attaching the .deb file. They will upload it to the correct internal repository and deploy it.