thelinuxlist/scripts/gitlabinstall.sh

30 lines
1.1 KiB
Bash

#!/bin/bash
while [ "$go" != 'y' ] && [ "$go" != 'n' ]; do
read -p "Would you like to install Gitlab? (y/n) " go
done
if [ "$go" == 'n' ]; then
exit
fi
sudo apt update && apt upgrade -y
sudo apt install tzdata curl ca-certificates openssh-server -y
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
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 "=================================================================="