The UK 2050 Calculator Web Flash Excel Wiki
Register or sign in
This is a wiki Anyone can contribute, therefore we don't vouch for its accuracy.

Update process

There are six steps:

  1. Update the excel model and share
  2. Update the decc_2050_model gem and test
  3. Update the twenty_fifty web front end and test
  4. Share the updated decc_2050_model code
  5. Create a binary version of the new decc_2050_model gem
  6. Share the updated twenty_fifty web code
  7. Update the live server

Update the excel model and share

Example: fixing ‘Bug 18' ("ammortised" should be "amortised" throughout the spreadsheet)

  1. check out master version from matrix (D11/669823)
  2. fix bug
  3. update version no in excel
  4. list changes in History of published versions of the 2050 Calculator
  5. move bug in bug spotter sheet to fixed section
  6. Save and check-in workbook - make note of change in check-in comments
  7. upload new mater version to the wiki, using naming convention: 'Excel 3.4.5'
    1. 'view' file in matrix
    2. 'save as ' to desktop and name as above
    3. select 'add a file' on the wiki
    4. give it title, e.g. 'Excel 3.4.6'
    5. give it content, e.g. 'History of published versions of the 2050 Calculator'
    6. go to History of published versions of the 2050 Calculator and add link to file

Update the decc_2050_model gem and test

  1. go to standalone
  2. make sure online
  3. open terminal
  4. cd decc_2050_model
  5. git pull
  6. create a new branch 'git branch version3.4.6'
  7. switch to new branch 'git checkout version 3.4.6'
  8. git push origin version3.4.6 (adds version of branch to github repository)
  9. download new version from wiki to decc_2050_modedl/spreadsheet/2050Model.xlsx (make sure file extension id not capitalised not XLSX)
  10. 'git status' to check spreadsheet has been updated
  11. bundle exec rake
  12. ruby test/test_2050_model_result.rb
  13. if there is an error look in test/expected_results and you will see a file that end in .actual. Compare his file (with Meld) with the equivalent json file and check that the changes are deliberate. If all is OK, then rename the .actual file to overwrite the json file. Re-run test and it should pass.
  14. gem build decc_2050_model.binary.gemspec
  15. sudo gem install decc_2050_model-3.4.Xpre-x86_64-linux.gem

Update the twenty_fifty web front end and test

  1. cd twenty-fifty
  2. git pull
  3. # create a new branch 'git branch version3.4.6'
  4. switch to new branch 'git checkout version 3.4.6'
  5. git push origin version3.4.6 (adds version of branch to github repository)
  6. vim Gemfile
  7. change version number to 3.4.6pre
  8. bundle --local
  9. rake html (compiles javascript etc) (NB on ubuntu may need to use 'bundle exec rake html')
  10. bundle exec rackup
  11. open 0.0.0.0:9292 in browser and check vs. online version (selection of views for a complex pathway)

Share the updated model code

  1. cd decc_2050_model
  2. update CHANGES file with changes
  3. git commit -am 'updated to version 3.4.6 of excel model'
  4. git push
  5. git rebase master
  6. git checkout master
  7. git merge --ff-only verson3.4.6
  8. git push
  9. gem build decc_2050_model.gemspec
  10. gem push decc_2050_model-3.4.6.gem

Create a binary version of the new decc_2050_model gem

  1. cd decc_2050_model
  2. cd util
  3. ruby build-ubuntu-native-binary-gem.rb
  4. gem push decc_2050_model-3.4.6-x86_64-linux.gem

Share the updated twenty_fifty web code

  1. cd twenty-fifty
  2. edit gemfile version no to remove the 'pre'
  3. bundle
  4. rake html
  5. bundle exec rackup
  6. open 0.0.0.0:9292 in browser and check vs. online version (selection of views for a complex pathway)
  7. git add --all
  8. git commit -am 'updated to version 3.4.6 of excel model'
  9. git push
  10. git rebase master
  11. git checkout master
  12. git merge --ff-only verson3.4.6
  13. git push

Update the live server

  1. ssh 2050
  2. cd twenty-fifty
  3. git status
  4. git pull
  5. bundle
  6. touch tmp/restart.txt