add prepare shell

This commit is contained in:
saga92 2016-04-19 18:29:44 +08:00
parent d721a69415
commit e537c1ac27

55
Deploy/prepare.sh Normal file
View File

@ -0,0 +1,55 @@
# Requires: openssl
## Configuration file of Harbor
#The IP address or hostname to access admin UI and registry service.
#DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname = "reg.mydomain.com"
#The protocol for accessing the UI and token/notification service, by default it is http.
#It can be set to https if ssl is enabled on nginx.
ui_url_protocol = "http"
#Email account settings for sending out password resetting emails.
email_server = "smtp.mydomain.com"
email_server_port = "25"
email_username = "sample_admin@mydomain.com"
email_password = "abc"
email_from = "admin <sample_admin@mydomain.com>"
##The password of Harbor admin, change this before any production use.
harbor_admin_password= "Harbor12345"
##By default the auth mode is db_auth, i.e. the credentials are stored in a local database.
#Set it to ldap_auth if you want to verify a user's credentials against an LDAP server.
auth_mode = "db_auth"
#The url for an ldap endpoint.
ldap_url = "ldaps://ldap.mydomain.com"
#The basedn template to look up a user in LDAP and verify the user's password.
ldap_basedn = "uid=%s,ou=people,dc=mydomain,dc=com"
#The password for the root user of mysql db, change this before any production use.
db_password = "root123"
#Turn on or off the self-registration feature
self_registration = "on"
#####
config_path = "./config"
ui_path = "./config/ui"
db_path = "./config/db"
tpl_path = "./templates"
mkdir -p $tpl_path
mkdir -p $ui_path $db_path
declare -a arr=("$ui_path/env" "$ui_path/app.conf" "$config_path/registry/config.yml" "$db_path/env")
for i in "${arr[@]}"; do
if -e $i; do
echo "Clearing the configuration file: "$i
rm $i
fi
done