Changes between Version 1 and Version 2 of DevNotes/Processeses/MarketplaceDeployment


Ignore:
Timestamp:
Sep 8, 2017 11:48:32 AM (3 years ago)
Author:
lewis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DevNotes/Processeses/MarketplaceDeployment

    v1 v2  
    1 Temp 
     1= Sasmodel Marketplace Deployment = 
     2 
     3== Website Deployment == 
     4Deployment for the Sasmodel Marketplace is mostly automatic: 
     5 
     6When a new commit is pushed to the [https://github.com/SasView/sasmodel-marketplace SasView/Sasmodel-Marketplace] repo on !GitHub, a Travis CI build is started. If the Travis build succeeds, it will push the changes to a bare git repo at {{{danse.chem.utk.edu:/home/git/marketplace.sasview.org}}}. This repo has a post-receive hook that will then checkout the code to {{{/var/www/marketplace.sasview.org}}}. 
     7 
     8If you add any new static files to the site (e.g. images, css files, etc), then you will need to follow the instructions in [https://github.com/SasView/sasmodel-marketplace/blob/master/README.md README.md] to ensure these are served correctly. 
     9 
     10The updated website will not be served until {{{sudo service apache2 reload}}} is ran. The server does actually restart every day, so if the changes don't need to be deployed immediately, you don't need to manually reload the server; the changes will take effect after the daily restart. 
     11 
     12== Automatic Model Updating == 
     13The entries on the marketplace for the models included with sasmodels will update automatically. 
     14 
     15When a new commit is pushed to [https://github.com/SasView/sasmodels SasView/sasmodels] a Travis CI build will run. If it succeeds, the latest code will be pushed to a bare git repo at {{{danse.chem.utk.edu:/home/git/sasmodels}}}. This repo has a post-receive hook that will checkout a copy of the code to {{{/var/www/marketplace.sasview.org/sasmodels}}}. It will then run the {{{upload_sasmodels.py}}} script in that directory. 
     16 
     17The {{{upload_sasmodels.py}}} script will check to see if any of the model files have changed, and if so, update their entries on the marketplace. If any new models have been added, they will be uploaded to the marketplace.[[BR]] 
     18This script does come with a caveat: if any model files are renamed, a new entry will be created for them on the marketplace, instead of updating the existing one. 
     19 
     20== User Permissions on the Server == 
     21Ideally, all files in the {{{/var/www/marketplace.sasview.org}}} directory should belong to the user/group 'www-data'. However, the post-receive hooks in the git repos that write files to this directory are ran by the user 'git', so the owner of the files can get changed. 
     22 
     23To fix this issue, the 'git' user has been added to the group 'www-data', and the 'www-data' user has been added to the group 'git'. The owning group has been given read & write access to all files in the directory, so both users should be able to read/write the files freely. 
     24 
     25If you need to make any manual changes in the {{{/var/www/marketplace.sasview.org}}} directory, make sure your user is a member of both the 'www-data' and 'git' groups. You can add a user to a group by running {{{sudo adduser [username] [group]}}}.[[BR]] 
     26Avoid using {{{sudo}}} when running commands that write to files (eg {{{git pull}}}), as this will set the owner of the files to 'root'.