This repository has been archived on 2024-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
thelinuxlist/scripts/gitlabinstall.sh

38 lines
1.3 KiB
Bash
Raw Normal View History

2022-10-20 10:23:01 -07:00
#!/bin/bash
2022-10-20 10:59:42 -07:00
while true
do
read -r -p "Would you like to install Gitlab? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
2022-10-20 11:02:52 -07:00
echo "That wasn't an option..."
2022-10-20 10:59:42 -07:00
;;
esac
2022-10-20 10:23:01 -07:00
done
sudo apt update && apt upgrade -y
2023-01-19 20:52:52 -08:00
sudo apt install tzdata curl ca-certificates openssh-server git -y
2022-10-20 10:23:01 -07:00
gpg_key_url="https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey"
curl -fsSL $gpg_key_url| sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/gitlab.gpg
sudo tee /etc/apt/sources.list.d/gitlab_gitlab-ce.list<<EOF
2023-01-20 16:01:40 -08:00
deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ jammy main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ jammy main
2022-10-20 10:23:01 -07:00
EOF
sudo apt update
sudo apt install gitlab-ce
sudo ufw allow https
sudo ufw allow http
sudo ufw allow ssh
2022-10-20 10:56:36 -07:00
sudo ufw reload
echo -e "=================================================================="
echo "Congrats on installing GitLab Community Edition"
echo "These are your login credentials, make sure to change them."
echo "Username: root"
cat /etc/gitlab/initial_root_password | grep Password:
echo -e "=================================================================="