User Tools

Site Tools


quick:gitlab_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
quick:gitlab_setup [2021/02/18 10:57]
bbarsch created
— (current)
Line 1: Line 1:
-====== Procedure to update user db code ====== 
- 
- 
-===== Clone the userdb code from the Gitlab Repo===== 
-1. Go to the directory you want to clone the repo to 
- 
- 
-2. Go to the repo in Gitlab and copy the ssh link: 
-<code> 
-git@git:protea/protea_database.git 
-</code> 
- 
-3. Note that git should be pointing to scp and not lengau, therefore in my .ssh/config file git2 points to scp so I use: 
-  git clone git@git2:protea/protea_database.git 
- 
- 
-4. Open your IDE, using sublime, and make changes to the code. 
- 
- 
-5. Save the code 
- 
- 
-6. Next step is to push the code 
- 
- 
- 
-===== Push the code back to Gitlab ===== 
- 
-1. Update, add, delete code and files. Then go to that directory you did the clone from and say: 
- 
-  git status 
- 
-2. this should show something is modified, and recommends you do: 
- 
-  git add . 
- 
- 
-3. And check with git status again that it has been added 
- 
- 
-4. Then do a commit: 
- 
- 
-  git commit -m "commit comment" 
- 
-5. Then lastly push the code to gitlab: 
- 
-  git push 
- 
-maybe asked for a password if you didn't do ssh-copy-id, use P@... as its done through scp 
-to not be asked for password do ssh-copy-id to scp (as shown in the previous section) 
- 
-Next we need to update the user database 
- 
-===== Update the userdb server ===== 
- 
-1.  Login in to the cluster (login2) by using the following command. (replace bbarsch with your username) 
- 
-  ssh bbarsch@lengau.chpc.ac.za 
- 
-2. Then ssh to users (Password is P@...): 
- 
-  ssh users2.chpc.ac.za  
- 
-3. Login as root user (superuser...note you need admin permission): 
- 
-  sudo su - 
- 
-4. Connect to chpc: 
- 
-  su - chpc 
- 
-5. Go to the user database directory: 
- 
-  cd protea_database/ 
- 
-6. Check the git status if any changes exist: 
- 
-  git status 
- 
-7. Downloads commits, files, and refs from a remote repository into your local repo by using git fetch: 
- 
-  git fetch 
- 
-8. Check if any local changes exist: 
- 
-  git stash 
- 
-9. Pull any changes from the repo: 
- 
-  git pull 
- 
-10. Pull any changes from submodules (helpdesk) linked to this repo: 
- 
-  git submodule update 
- 
-11. Get back in to root user by logging out from chpc using: 
- 
-  ctrl+d 
- 
-12. Restart the gunicorn service: 
- 
-  systemctl restart gunicorn.service 
- 
-13. Start ngninx: 
- 
-  systemctl start nginx 
- 
-14. Flush redis: 
- 
-  redis-cli flushall 
- 
-15. Close the terminal and go to the users2 site on a browser to see changes: 
- 
-  users2.chpc.ac.za 
- 
-- Note to do the same for usersdev you must tunnel in as its internal, use the command: 
- 
-  ssh -N -L 8888:usersdev.chpc.ac.za:80 scp.chpc.ac.za 
- 
-- then go to localhost:8888 
- 
  
/app/dokuwiki/data/attic/quick/gitlab_setup.1613638639.txt.gz · Last modified: 2021/12/09 16:42 (external edit)