thelinuxlist/scripts/gitlabinstall.sh

39 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
sudo apt install tzdata curl ca-certificates openssh-server -y
2022-10-21 02:35:20 -07:00
sudo apt-get install 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
deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main
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 "=================================================================="