Difference between revisions of "GPG guide/Repository and Publishing"

From LibrePlanet
Jump to: navigation, search
(Pushing to the Live Instance)
Line 51: Line 51:
 
Due to some poor design decisions (made by Zak) early on in this project, a clean, git-only workflow isn't possible for publishing right now. Instead, to publish:
 
Due to some poor design decisions (made by Zak) early on in this project, a clean, git-only workflow isn't possible for publishing right now. Instead, to publish:
  
* Check out the dev repo *and* the live repo on the same computer.
+
* Check out the dev repo *and* the live repo on the same computer. If you already have them, make sure they are both up to date.
 
* Manually copy the directories for the languages you want to publish from the dev to the live site, but don't push yet
 
* Manually copy the directories for the languages you want to publish from the dev to the live site, but don't push yet
 
* Test the new languages locally. To do this, you'll need to set up a local server. See the instructions at https://libreplanet.org/wiki/GPG_guide/Setting_Up_Your_Local_Development_Environment
 
* Test the new languages locally. To do this, you'll need to set up a local server. See the instructions at https://libreplanet.org/wiki/GPG_guide/Setting_Up_Your_Local_Development_Environment

Revision as of 16:21, 6 July 2016

Checkout Out Project for editing/translating

To do this, you'll need to have the FSF tech team give you access. See the instructions at https://libreplanet.org/wiki/GPG_guide/Translation_Guide. If you want to download the repository but do not intend to directly edit the master copy, see the instructions below.

The repository can be checked out via the following command: git clone git@vcs.fsf.org:enc.git --recursive. After checking out, make sure you are on the master branch of the repository.

NOTE: The --recursive option will checkout this projects submodule, which for this project is used for commiting static content into static.fsf.org. If you forget the --recursive option, you can get the submodule later with the following command: git submodule update --init

The static submodule

The static assets for the email self-defense guide are kept in another repository, enc-static. In order to add new files to it, i.e. infographic translations, commits must be made to this repository, and the updated submodule must be commited to the enc repository. The workflow resembles the following:

cd static/ # enter the enc-static repository
git checkout master # the submodule is in a detached state, go to master HEAD
touch img/es/donate.png # make a change
git add img/es/donate.png
git commit -m "es: Added donate image."
git push
cd .. # back to enc repository
git add static
git commit -m "Bump submodule." # Commit new version of static submodule
git push

It's important to remember that the static/ directory is another repository and you must commit to it separately from enc. It is also important to maintain the proper order of operations, as demonstrated above. Do not push a commit to enc that bumps the submodule if the new commits to enc-static have not been pushed. Always push to enc-static first.

After running `git pull`, it's good to run `git submodule update` to get the latest static assets.

Checking out the project for read-only access

You may want to do this if you plan to create diffs and send them to the FSF as suggested edits, rather than editing directly. You do not need permission for this.

git clone https://vcs.fsf.org/git/enc.git


The Hooks

The repository has the following hooks:

Pushing to the Live Instance

NOTE: Access to the live site is restricted, access is given on an as needed basis.

Due to some poor design decisions (made by Zak) early on in this project, a clean, git-only workflow isn't possible for publishing right now. Instead, to publish:

  • Check out the dev repo *and* the live repo on the same computer. If you already have them, make sure they are both up to date.
  • Manually copy the directories for the languages you want to publish from the dev to the live site, but don't push yet
  • Test the new languages locally. To do this, you'll need to set up a local server. See the instructions at https://libreplanet.org/wiki/GPG_guide/Setting_Up_Your_Local_Development_Environment
  • Push your updated live repo.

This is the more "correct" method, which you should not use right now, but which will again be appropriate some day.

  • Add the following remote repository: git remote add live git@vcs.fsf.org:enc-live.git
  • When you are ready to push to the live site, use: git push live master
  • Your changes will be then pushed to http://emailselfdefense.fsf.org