-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathjenkins_master_slave
More file actions
98 lines (73 loc) · 2.8 KB
/
jenkins_master_slave
File metadata and controls
98 lines (73 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Steps to install masterNode
------------------------------
sudo yum -y install openjdk-8-jdk
sudo yum -y install git
sudo yum -y install maven
sudo yum -y wget ( if needed)
Steps to install Jenkins
------------------------------
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum -y install jenkins
sudo systemctl start jenkins
sudo systemctl enable --now jenkins
Steps to install Docker Amazon linux2
sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo usermod -a -G docker jenkins
docker info
How to enable shell console for jenkins user ?
----------------------------------------------------------------
Open a file using vi editor
sudo vi /etc/passwd
for jenkins user change to /bin/bash
How to give sudo permissions for jenkins user in Centos machine in Master Node?
----------------------------------------------------------------
Open a file using vi editor
1) sudo vi /etc/sudoers
2) add below line in sudoers file
jenkins ALL=(ALL) NOPASSWD: ALL
3)sudo systemctl restart jenkins
Steps to install SlaveNode
------------------------------
Change to Root user
------------------------------
sudo su -
sudo yum -y install openjdk-8-jdk
sudo yum -y install maven ( if u install maven ,automatically java will install in machine)
sudo yum -y install git
How to create new user in Centos ?
------------------------------
sudo useradd jenkins
sudo su jenkins
cd
cd
How to give sudo permissions for jenkins user in Centos machine in Slave Node?
----------------------------------------------------------------
Open a file using vi editor
1) sudo vi /etc/sudoers
2) add below line in sudoers file
jenkins ALL=(ALL) NOPASSWD: ALL
How to check current working directory ?
----------------------------------------
pwd - /var/lib/jenkins ( Home directory for jenkins in slave node)
mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh
ssh-keygen -t rsa -C "The access key for Jenkins slaves"
Type enter button for every question so that it will create default private key(id_rsa) and public key(id_rsa.pub)
cat id_rsa.pub > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
cat id_rsa ( Copy private key and paste in jenkins node slave)
How to setup slave node in jenkins ( Please refer videos in below url)
--------------------------------------------------------------------------------
https://www.youtube.com/watch?v=c-OZcpHiOPc&list=PL87padGs1bp9X95IxGQtFW44qWzywhbHM
Scripts to deploy website from GitHub
----------------------------------------
sudo yum install -y httpd
sudo systemctl restart httpd
sudo rm -rf /var/www/*
sudo rm -rf /var/www/html/.git
sudo git clone https://github.com/javaexpresschannel/staticwebsitehosting.git /var/www/html/