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

Sep 8, 2017 11:48:32 AM (3 years ago)


  • DevNotes/Processeses/MarketplaceDeployment

    v1 v2  
    1 Temp 
     1= Sasmodel Marketplace Deployment = 
     3== Website Deployment == 
     4Deployment for the Sasmodel Marketplace is mostly automatic: 
     6When a new commit is pushed to the [ 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 {{{}}}. This repo has a post-receive hook that will then checkout the code to {{{/var/www/}}}. 
     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 [] to ensure these are served correctly. 
     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. 
     12== Automatic Model Updating == 
     13The entries on the marketplace for the models included with sasmodels will update automatically. 
     15When a new commit is pushed to [ SasView/sasmodels] a Travis CI build will run. If it succeeds, the latest code will be pushed to a bare git repo at {{{}}}. This repo has a post-receive hook that will checkout a copy of the code to {{{/var/www/}}}. It will then run the {{{}}} script in that directory. 
     17The {{{}}} 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. 
     20== User Permissions on the Server == 
     21Ideally, all files in the {{{/var/www/}}} 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. 
     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. 
     25If you need to make any manual changes in the {{{/var/www/}}} 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'.