Skip to content

Commit

Permalink
Merge pull request unkn0w#207 from pablowyourmind/fixes/chce_jenkins_…
Browse files Browse the repository at this point in the history
…sh_update

unkn0w#206 Aktualizacja skryptu chce_jenkins.sh + dodatki
  • Loading branch information
loper authored Oct 20, 2024
2 parents 395b37e + 0b31383 commit acb6d49
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/chce_jenkins.sh
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
#!/bin/bash
# Jenkins na mikrusowym porcie
# Autor: Maciej Loper, Radoslaw Karasinski
# Autor: Maciej Loper, Radoslaw Karasinski, pablowyourmind

status() {
echo "[x] $1"
}

read -p "Podaj port, na którym ma działać Jenkins. Brak podania numeru spowoduje ustawienie portu 80:" port
port=${port:-80}
status "Jenkins będzie nasłuchiwał na porcie $port"

status "instalacja wymaganych pakietow"
sudo apt install -y gnupg
echo

status "dodawanie repozytorium Jenkinsa"
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

status "aktualizacja repozytoriow"
sudo apt update
echo

status "instalacja Jenkinsa i Javy JRE11"
sudo apt install -y openjdk-11-jre-headless
status "instalacja Jenkinsa i Javy JRE17"
sudo apt install -y openjdk-17-jre-headless
sudo apt install -y jenkins
echo

status "poprawki w konfiguracji"
sudo systemctl stop jenkins
sed -i 's|User=jenkins|User=root|' /lib/systemd/system/jenkins.service
sed -i 's|JENKINS_PORT=8080|JENKINS_PORT=80|' /lib/systemd/system/jenkins.service
sed -i "s|JENKINS_PORT=8080|JENKINS_PORT=$port|" /lib/systemd/system/jenkins.service
sed -i 's|JAVA_OPTS=-Djava.awt.headless=true|JAVA_OPTS=-Djava.awt.headless=true -Xms256m -Xmx512m|' /lib/systemd/system/jenkins.service
sudo systemctl daemon-reload
echo

status "uruchomienie"
sudo systemctl start jenkins
echo

echo -n "Gotowe. Jenkins nasłuchuje na porcie 80. Haslo poczatkowe: "
cat /var/lib/jenkins/secrets/initialAdminPassword

echo -n "Gotowe. Jenkins nasłuchuje na porcie $port. Hasło początkowe: "
cat /var/lib/jenkins/secrets/initialAdminPassword

0 comments on commit acb6d49

Please sign in to comment.