Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@versionsix
Created January 23, 2019 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save versionsix/602593df37396017de4ca15aa314f06c to your computer and use it in GitHub Desktop.
Save versionsix/602593df37396017de4ca15aa314f06c to your computer and use it in GitHub Desktop.
Install gitlab ubuntu1804
#!/bin/bash
DEBIAN_FRONTEND=noninteractive apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y curl openssh-server ca-certificates
DEBIAN_FRONTEND=noninteractive apt-get install -y postfix unattended-upgrades
# on centos use yum-cron instead of unattended-upgrades
cat <<'EOF' > /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
"${distro_id}ESM:${distro_codename}";
"${distro_id}:${distro_codename}-updates";
};
Unattended-Upgrade::Package-Blacklist {
};
Unattended-Upgrade::DevRelease "false";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "05:43";
EOF
cat <<'EOF' > /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
EOF
# unattended-upgrades --dry-run --debug
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | bash
GITLAB_ROOT_PASSWORD="secret_pass" EXTERNAL_URL="$(hostname)" apt-get -y install gitlab-ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment