Last active
March 9, 2018 22:22
-
-
Save ams0/304867d9a6ae7e31ef01820e0f0f8dd8 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://ci.cookingwithazure.com" 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