Last active
July 13, 2023 06:50
-
-
Save s-en-o/b091acb1c8336a19ad10a22ff47e965d to your computer and use it in GitHub Desktop.
Ubuntu bash script to install Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Change user as root | |
sudo su - | |
# Add Jenkins aptitude key | |
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \ | |
/usr/share/keyrings/jenkins-keyring.asc > /dev/null | |
# Add the Jenkins debian repo to the aptitude sources list: | |
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ | |
https://pkg.jenkins.io/debian binary/ | sudo tee \ | |
/etc/apt/sources.list.d/jenkins.list > /dev/null | |
# Update the source lists and upgrade any out of date packages: | |
apt update | |
apt -y upgrade | |
# Install the software for the Jenkins master: openjdk-11-jdk, nginx, and jenkins. | |
# Install JDK and nginx first: | |
apt -y install fontconfig openjdk-11-jre nginx | |
# Then install jenkins: | |
apt -y install jenkins | |
# Confirm that jenkins and nginx are installed: | |
systemctl status nginx | grep Active | |
systemctl status jenkins | grep Active |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment