Repository navigation
Expand file tree
/
Copy pathscript.sh
More file actions
42 lines (33 loc) · 1.39 KB
/
Copy pathscript.sh
File metadata and controls
42 lines (33 loc) · 1.39 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
#!/bin/bash
# Update and install Java
sudo apt update -y
sudo apt install fontconfig openjdk-21-jre -y
# Add Jenkins key and source list
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
# Update and install Jenkins
sudo apt-get update -y
sudo apt-get install jenkins -y
# Enable and start Jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins
# Install Docker
sudo apt update -y
sudo apt install docker.io -y
sudo systemctl enable docker
sudo systemctl start docker
# Add Jenkins and Ubuntu user to Docker group
sudo usermod -aG docker jenkins
sudo usermod -aG docker ubuntu
newgrp docker
# Fix permissions
sudo chmod 777 /var/run/docker.sock
# aws cli
sudo apt install unzip -y
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
# install terraform
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform -y