Difference between revisions of "Guide - Web Project Environment"

From CsWiki
Jump to: navigation, search
(Guide - Web Project Environment)
(Postgres)
 
(2 intermediate revisions by the same user not shown)
Line 17: Line 17:
  
 
<blockquote>
 
<blockquote>
User: pr_<project_name>
+
'''User: pr_<project_name>'''
  
Group: pr_<project_name
+
'''Group: pr_<project_name>'''
 
</blockquote>
 
</blockquote>
  
Line 27: Line 27:
 
For projects which contains scripts for the projects which includes scripts other than web
 
For projects which contains scripts for the projects which includes scripts other than web
 
<blockquote> '''Root project folder'''
 
<blockquote> '''Root project folder'''
/cs/labs/<researcher_cs_login>/
+
'''/cs/labs/<researcher_cs_login>/'''
 
</blockquote>
 
</blockquote>
 
<blockquote> '''project group permissions'''
 
<blockquote> '''project group permissions'''
/projects/<projectname>
+
'''/projects/<projectname>'''
 
</blockquote>
 
</blockquote>
  
Line 41: Line 41:
 
'''/projects/<projectname>/  '''
 
'''/projects/<projectname>/  '''
  
:[production | release | develop]
+
:['''production | release | develop''']
::webserver/ # developer allowed to git pull + write
+
::'''webserver/'''# developer allowed to git pull + write
::data/ ## web server user + group allowed to write
+
::'''data/''' ## web server user + group allowed to write
::logs/ ## web server user + group allowed to write
+
::'''logs/''' ## web server user + group allowed to write
::[ slurp/  ## slurp scripts (if required)]
+
::[ '''slurp/''' ## slurp scripts (if required)]
 
</blockquote>
 
</blockquote>
  
Line 63: Line 63:
 
'''<project_name>.release.cs.huji.ac.il''' (used to be testing, git branch release)
 
'''<project_name>.release.cs.huji.ac.il''' (used to be testing, git branch release)
  
''''<project_name>.develop.cs.huji.ac.il '''(used to be development if needed, git branch develop)
+
'''<project_name>.develop.cs.huji.ac.il '''(used to be development if needed, git branch develop)
  
 
</blockquote>
 
</blockquote>
Line 74: Line 74:
  
 
<blockquote>
 
<blockquote>
'''<projectname>_production''' (used to be production)
+
'''pr_<projectname>_production'''
  
'''<projectname>_release''' (used to be release)
+
'''pr_<projectname>_release'''
  
'''<projectname>_develop'''(used to be development
+
'''pr_<projectname>_develop'''(only if required by the developers.)
 
</blockquote>
 
</blockquote>
  

Latest revision as of 11:03, 8 March 2020

By Shai Yerushalmi
Last update 26.11.2019


First there is a need to create a name for the project which will be its url subdomain i.e. for project name 'myproject' - myproject.cse.huji.ac.il

Users and Permissions

The project is managed by an actual single user who is the developer in charge.

Additional webserver user will run the web services CSE system will create a user for the webserver to which only cs system can use for security reasons; For each project there will be a group. This group will have all the developers for this projects + the webserver user.

User: pr_<project_name>

Group: pr_<project_name>

Files System

The main folder will be the lab/project main folder in which there will be a folder called webserver. Under the webserver folder there will be folder for each environment. Although not all environment will be used during the development phase the file tree is still a must.

For projects which contains scripts for the projects which includes scripts other than web

Root project folder

/cs/labs/<researcher_cs_login>/

project group permissions

/projects/<projectname>


Directory Structure

Every project will have three environments for production, testing and development if needed


/projects/<projectname>/

[production | release | develop]
webserver/# developer allowed to git pull + write
data/ ## web server user + group allowed to write
logs/ ## web server user + group allowed to write
[ slurp/ ## slurp scripts (if required)]


/projects/<projectname>/share

  • used for share info
  • project group permissions


URL's

<project_name>.cs.huji.ac.il (git branch master)

<project_name>.release.cs.huji.ac.il (used to be testing, git branch release)

<project_name>.develop.cs.huji.ac.il (used to be development if needed, git branch develop)

Database

The recommended database is postgres. It is not always the #1 choice of all the developers, yet it extremely powerful and flexible and worth the extra effort required for the initial setup.

Postgres

Each environment will get a database in which you can add multiple schemas

pr_<projectname>_production

pr_<projectname>_release

pr_<projectname>_develop(only if required by the developers.)

MySql

Same naming convention as Postgres


Logs

Log records that are related to server or database errors save to the syslog, so it can be viewed and monitor by the cs-system.

Other log records should be in internal folder of the environment.

Email Aliases

Email alias will be created for the project upon request in order to use for email alerts / API external account/ logins etc.,

pr_<projectname>

Daemons

Daemons will run on a specific user which belong to the webserver group. There will not be a specific user for running daemons.

Git Branching

There are many git branching methodologies. Yet, since often we will need to help with implementation or some maintenance, the git branching is important to be comprehensive and reliable for usage. Therefore we follow specific guidelines strictly, according to the documentation of bitbucket got gitflow workflow https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

master (production) -> hotfix

release (testing / release / staging)
develop (development)
feature-branch#feature
  • hotfix - a branch used for quick fixes on master, use only on emergency!
  • Please be caution on rebase and merge.
  • Before merging a branch up a child branch, make sure you rebase the parent branch since it may be changed by another developer.