mirror of
https://github.com/YunoHost-Apps/jenkins_ynh.git
synced 2024-09-03 19:26:18 +02:00
36 lines
904 B
Bash
36 lines
904 B
Bash
#!/bin/bash
|
|
|
|
# Retrieve arguments
|
|
domain=$1
|
|
path=$2
|
|
|
|
sudo yunohost app checkport 8080
|
|
if [[ ! $? -eq 0 ]]; then
|
|
echo "Port 8080 is not available. Aborting..."
|
|
exit 1
|
|
fi
|
|
|
|
# Check domain/path availability
|
|
sudo yunohost app checkurl $domain$path -a jenkins
|
|
if [[ ! $? -eq 0 ]]; then
|
|
exit 1
|
|
fi
|
|
|
|
echo "Install dependencies..."
|
|
wget -q -O - "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key" | sudo apt-key add -
|
|
sudo bash -c "cat > /etc/apt/sources.list.d/jenkins.list << EOF
|
|
deb http://pkg.jenkins-ci.org/debian binary/
|
|
EOF
|
|
"
|
|
|
|
sudo apt-get update
|
|
sudo apt-get install jenkins -y
|
|
sudo service jenkins start
|
|
|
|
sudo yunohost service add jenkins -l /var/log/jenkins/jenkins.log
|
|
|
|
echo "Nginx configuration (sso disabled)..."
|
|
sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf
|
|
sudo service nginx reload
|
|
sudo yunohost app ssowatconf
|