Difference between revisions of "Github CI/CD"

From Logic Wiki
Jump to: navigation, search
Line 31: Line 31:
 
  sudo ./svc.sh install
 
  sudo ./svc.sh install
 
  sudo ./svc.sh start
 
  sudo ./svc.sh start
−
 
+
−
 
+
== Sudo Trick ==
 +
sudo visudo -f /etc/sudoers.d/<USERNAME>
 +
in the file
 +
<USERNAME> ALL=(ALL) NOPASSWD: /usr/sbin/service nginx start, /usr/sbin/service nginx stop, /usr/sbin/service nginx restart
 +
With this Linux will not ask sudo pass for stop start restart of nginx
  
  
 
---------------------
 
---------------------
 
see : [https://www.youtube.com/watch?v=6-RtA6FlbgQ&list=PL_7mM2_n2qvbtLhKo6Ijqt2cnmCAd2JVi&index=10&t=2348s https://www.youtube.com/watch?v=6-RtA6FlbgQ&list=PL_7mM2_n2qvbtLhKo6Ijqt2cnmCAd2JVi&index=10&t=2348s]
 
see : [https://www.youtube.com/watch?v=6-RtA6FlbgQ&list=PL_7mM2_n2qvbtLhKo6Ijqt2cnmCAd2JVi&index=10&t=2348s https://www.youtube.com/watch?v=6-RtA6FlbgQ&list=PL_7mM2_n2qvbtLhKo6Ijqt2cnmCAd2JVi&index=10&t=2348s]

Revision as of 09:55, 5 April 2022


Preparing Linux

In Linux you have to do everything with a user but not root.

In order to create a user use adduser command

NGinx setup

Follow Nginx

Github Runner

Like the agents in TFS Github has runners So we need to install runners to pull github repositories when they are pushed.

1 - Go to repository

2 - Go to settings

3 - Go to Actions -> Runners

4 - Click New self-hosted runner

5 - Select the operating system

6 - Go to the folder you want to install the runner and pull the codes in your environment

7 - Give full permission

sudo chmod -R 777 /var/www/FrontEnd

8 - Follow the download steps in github

9 - Follow the Configure steps in github

sudo ./svc.sh install
sudo ./svc.sh start

Sudo Trick

sudo visudo -f /etc/sudoers.d/<USERNAME>

in the file

<USERNAME> ALL=(ALL) NOPASSWD: /usr/sbin/service nginx start, /usr/sbin/service nginx stop, /usr/sbin/service nginx restart

With this Linux will not ask sudo pass for stop start restart of nginx



see : https://www.youtube.com/watch?v=6-RtA6FlbgQ&list=PL_7mM2_n2qvbtLhKo6Ijqt2cnmCAd2JVi&index=10&t=2348s