Files
gitlab/abra.sh

39 lines
955 B
Bash

#!/bin/bash
GITLAB_CONF_VERSION=v1
ENTRYPOINT_VERSION=v1
RUNNER_ENTRYPOINT_VERSION=v1
RUNNER_CONF_VERSION=v1
run_rails_command() {
su -p root -s /bin/sh -c "gitlab-rails runner '$@'"
}
reconfigure() {
su -p root -s /bin/sh -c "gitlab-ctl reconfigure"
}
disable_basic_login() {
run_rails_command 'Gitlab::CurrentSettings.update!(password_authentication_enabled_for_web: false)'
reconfigure
}
enable_basic_login() {
run_rails_command 'Gitlab::CurrentSettings.update!(password_authentication_enabled_for_web: true)'
reconfigure
}
disable_signups() {
run_rails_command 'Gitlab::CurrentSettings.update!(signup_enabled: false)'
reconfigure
}
enable_signups () {
run_rails_command 'Gitlab::CurrentSettings.update!(signup_enabled: true)'
reconfigure
}
register_runner() {
RUNNER_TOKEN="$1"
gitlab-runner register --non-interactive --url "https://$CI_SERVER_URL" --token "$RUNNER_TOKEN" --executor "docker"
}