Created
April 21, 2018 21:13
-
-
Save ams0/b31010266c92ccb2fe09f791bc23313c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#install Gitlab CE | |
yum -y update | |
yum install -y curl policycoreutils-python epel-release | |
yum -y install nginx | |
yum install -y postfix | |
systemctl enable postfix | |
systemctl start postfix | |
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-Ce/script.rpm.sh | bash | |
sudo EXTERNAL_URL="https://external_url" yum install -y gitlab-ce | |
cat <<EOF >> /etc/gitlab/gitlab.rb | |
letsencrypt['enable'] = true | |
letsencrypt['contact_emails'] = ['[email protected]'] # Optional | |
nginx['redirect_http_to_https'] = yes | |
gitlab_rails['omniauth_enabled'] = true | |
gitlab_rails['omniauth_allow_single_sign_on'] = ['azure_oauth2'] | |
gitlab_rails['omniauth_block_auto_created_users'] = false | |
gitlab_rails['sync_profile_from_provider'] = ['azure_oauth2'] | |
gitlab_rails['sync_profile_attributes'] = ['name', 'email'] | |
gitlab_rails['omniauth_external_providers'] = ['azure_oauth2'] | |
gitlab_rails['omniauth_providers'] = [ | |
{ | |
"name" => "azure_oauth2", | |
"args" => { | |
"client_id" => "client_id", | |
"client_secret" => "client_secret", | |
"tenant_id" => "tenant_id", | |
} | |
} | |
] | |
EOF | |
gitlab-ctl reconfigure | |
gitlab-ctl restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment