There are quite a few examples on the internet how to set Jenkins build server on the EC2 instance from AWS so I won't need to explicitly explain all steps and rather will put the list of them.
So first You'll need an AWS account which is abnormally easy to create. After that, we can proceed with launching a free EC2 instance (t2.micro) and assigning security groups to it.
1. Settings for EC2 instance:
- Network --> Default VPC (or Your custom one if You have it already)
- Subnet --> Default subnet (or Your public subnet if You have one)
- Auto-assign Public IP should be enabled
- Before launching instance go to Edit security groups --> add Your security group (if You have one, otherwise go to Create Security Group --> Add name & description --> Set Your VPC --> Add rule (create SSH, HTTP, Custom TCP Rule port should be 8080))
- Launch
2. Connect to the EC2 instance:
- After launching instance there's an option in the menu about how to connect to Your instance otherwise follow next steps
- $ ssh -i /path/my-key-pair.pem ec2-user@your-instance-public-address
3. Install and launch Jenkins
- $ sudo yum update -y (usually this is recommended step for all new instances of Amazon Linux)
- $ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo (getting Jenkins package)
So first You'll need an AWS account which is abnormally easy to create. After that, we can proceed with launching a free EC2 instance (t2.micro) and assigning security groups to it.
1. Settings for EC2 instance:
- Network --> Default VPC (or Your custom one if You have it already)
- Subnet --> Default subnet (or Your public subnet if You have one)
- Auto-assign Public IP should be enabled
- Before launching instance go to Edit security groups --> add Your security group (if You have one, otherwise go to Create Security Group --> Add name & description --> Set Your VPC --> Add rule (create SSH, HTTP, Custom TCP Rule port should be 8080))
- Launch
2. Connect to the EC2 instance:
- After launching instance there's an option in the menu about how to connect to Your instance otherwise follow next steps
- $ ssh -i /path/my-key-pair.pem ec2-user@your-instance-public-address
3. Install and launch Jenkins
- $ sudo yum update -y (usually this is recommended step for all new instances of Amazon Linux)
- $ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo (getting Jenkins package)
- $ sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key (import Jenkins key)
- $ sudo install jenkins -y
- $ sudo service jenkins start
- http://your-server-public-DNS:8080 (address for your Jenkins server)
- $ sudo cat /var/lib/jenkins/secrets/initialAdminPassword (initial Jenkins admin password)
After connecting to Jenkins it's recommended to setup Your password and install needed plugins (one from important list is Amazon EC2 plugin if You are planning to connect that instance to other AWS boxes)
No comments:
Post a Comment