diff options
Diffstat (limited to 'docs/updating')
-rw-r--r-- | docs/updating/ami.md | 51 | ||||
-rw-r--r-- | docs/updating/index.md | 74 | ||||
-rw-r--r-- | docs/updating/templates.md | 63 |
3 files changed, 188 insertions, 0 deletions
diff --git a/docs/updating/ami.md b/docs/updating/ami.md new file mode 100644 index 000000000..48d8cb065 --- /dev/null +++ b/docs/updating/ami.md @@ -0,0 +1,51 @@ +--- +layout: page +title: Updating an AMI installation +--- + +# Updating an AMI installation + +<p class="lead">Let's say you set up an EC2 instance from our AMI when FixMyStreet was on +version 2.0, and you now want to upgrade to version 2.1. This page should +help.</p> + +(If you forked the code on GitHub and cloned it yourself, you probably want to see our +main [update help](/updating/).) + +Firstly, log in to your EC2 instance as the `ubuntu` user, as you did when +setting up the instance. You should become the fms user and switch to the right +directory: + + ubuntu@ip-10-58-191-98:~$ sudo su - fms + fms@ip-10-58-191-98:~$ cd fixmystreet + fms@ip-10-58-191-98:~/fixmystreet$ + +To fetch new upstream code, but not yet use it, use: + + fms@ip-10-58-191-98:~/fixmystreet$ git fetch origin + +Then merging the new version of the upstream code into your version will bring +your code up-to-date. You can do that with: + + fms@ip-10-58-191-98:~/fixmystreet$ git merge v2.1 + +If you have made alterations to your local repository, then you will need to +make sure they are all committed to your local branch and fork first, see +[setting up a fork](/feeding-back/) for more information. You may want +to try checking out your repository elsewhere and trying the merge there first, +to see if it there are any problems. + +After updating the code, you should run the following command to update any +needed dependencies and any schema changes to your database. It's a good idea +to take a backup of your database first. + + fms@ip-10-58-191-98:~/fixmystreet$ script/update + +If you have made changes to the schema yourself, this may not work, +please feel free to [contact us](/community/) to discuss it first. + +Lastly, you should restart the Catalyst FastCGI server with: + + fms@ip-10-58-191-98:~/fixmystreet$ logout + ubuntu@ip-10-58-191-98:~$ sudo /etc/init.d/fixmystreet restart + diff --git a/docs/updating/index.md b/docs/updating/index.md new file mode 100644 index 000000000..e65097e6d --- /dev/null +++ b/docs/updating/index.md @@ -0,0 +1,74 @@ +--- +layout: page +title: Updating your installation +--- + +# Updating your installation + +<p class="lead">Keeping your installation up to date means you get new features +and bug fixes implemented by other users of the platform.</p> + +Please read the guidelines for [feeding back changes](/feeding-back/) -- if +you follow those when working on your site it should be much easier for you to +keep your code up to date with upstream. In the best case scenario, if you +submit frequent pull requests and keep up to date, you shouldn't run into many +conflicts at all. + +If your cobrand is not present upstream, then you may want to check changes in +core templates against your cobrand before updating – [we have a script to help +with that](/updating/templates/). + +## Updating the code itself + +The `master` branch of the main FixMyStreet repository should always be safe, +stable, and deployable. On top of that, we have fixed version numbers that our +install script and packaged options use, and you are welcome to as well. + +<div class="attention-box info"> +<strong>Install script/ package users:</strong> Note that if you have used the install script or +a packaged image, then your repository by default will be cloned from the main +FixMyStreet repository. Please see our <a href="ami/">package-specific updating instructions</a>. +</div> + +Let's say you have forked the main FixMyStreet repository on GitHub, and you +have cloned your fork and have been working on that. You have made some commits +that you have not yet submitted upstream to be merged in. GitHub have some +[helpful instructions](https://help.github.com/articles/fork-a-repo) on pulling +in upstream changes, and it basically boils down to: + +{% highlight bash %} +# If you haven't set up the remote before +git remote add upstream https://github.com/mysociety/fixmystreet.git +# Fetch new commits from upstream +git fetch upstream +# Merge those commits into your current branch +# Or whichever version tag e.g. v2.5 +git merge upstream/master +{% endhighlight %} + +If you're proficient with git, of course feel free to rebase your changes on +top of the upstream master, or however else you wish to best go about the +issue :-) Doing this frequently will help prevent you get in a situation where +you are too worried to merge in case it breaks something. + +## Subsequent dependency updates + +After updating the code, you should run the following command to update any +needed dependencies and any schema changes to your database. It's a good idea +to take a backup of your database first. + +{% highlight bash %} +script/update +{% endhighlight %} + +Of course, if you have made changes to the database schema yourself, this may +not work, please feel free to [contact us](/community/) to discuss it first. + +## Restart the server + +Lastly, you should restart your application server, this may be restarting +your webserver, or if it is running separately, something like: + +{% highlight bash %} +sudo /etc/init.d/fixmystreet restart +{% endhighlight %} diff --git a/docs/updating/templates.md b/docs/updating/templates.md new file mode 100644 index 000000000..ee4fca7e5 --- /dev/null +++ b/docs/updating/templates.md @@ -0,0 +1,63 @@ +--- +layout: page +title: Updating your installation +--- + +# Checking core template changes against your cobrand + +<p class="lead">You may have your own cobrand, overriding templates in core, +and wish to check what changes there have been in core since your current +version, to see whether you need to make similar/related changes to your +cobrand templates. We provide a script to help with this.</p> + +First, let's assume your cobrand is called `fixmypark` and you are in a git +repository with your current code checked out, but with access to the new +version you wish to compare against (ie. your repository is up to date with +upstream via `git fetch`, see below). + +Then you can run the following to list templates that have changed between the +most recent version accessible from the current checkout and the newest +available version: + +{% highlight bash %} +$ bin/cobrand-checks fixmypark +templates/web/base/report/update-form.html +{% endhighlight %} + +If you prefer to be more explicit, you can specify old and new revisions: + +{% highlight bash %} +$ bin/cobrand-checks fixmypark v2.3 v2.4 +templates/web/base/report/new/after_photo.html +{% endhighlight %} + +## --diff + +If you specify `--diff`, you get a diff of the changes in core templates +between the specified versions, but only in templates that your cobrand +has overridden: + +{% highlight diff %} +$ bin/cobrand-checks fixmypark v2.3 v2.4 --diff +diff --git a/templates/web/base/report/new/after_photo.html b/templates/web/base/report/new/after_photo.html +index b337977e4..4b28bf7f7 100644 +--- a/templates/web/base/report/new/after_photo.html ++++ b/templates/web/base/report/new/after_photo.html +@@ -1,3 +1,4 @@ ++[% IF c.cobrand.allow_photo_upload %] + <div class="description_tips" aria-label="[% loc('Tips for perfect photos') %]"> + <ul class="do"> + <li>[% loc('For best results include a close-up and a wide shot') %]</li> +@@ -6,3 +7,4 @@ + <li>[% loc('Avoid personal information and vehicle number plates') %]</li> + </ul> + </div> ++[% END %] +{% endhighlight %} + +## --interactive + +For more advanced usage, `--interactive` will step through those files one by +one, letting you pick various different diffs (e.g. core change version to +version, or the change between old/new version and your cobrand), and edit your +cobrand template using vimdiff. |