Commit 48c0cbb4 authored by Michel Memeteau's avatar Michel Memeteau

Merge branch '187-repo-mode-to-retrieve-application-recipe' into 'develop'

Resolve "REPO mode to retrieve application recipe"

See merge request !188
parents 0784a884 41d64fb5
#!/bin/bash
#Current version of libre.sh to be installed
LIBRE_VERSION=1.1
# System env vars
LIBRE_VERSION=187-repo-mode-to-retrieve-application-recipe
# System env vars : can be overrided by a values.env file next to this install file
## domain handling
### TODO : Specify you template repo ROOT
### CONFIG : Specify you template repo ROOT without training slash (Optional) or comment if you want to supply full url for apps
APP_REPO_URL="lab.libreho.st/libre.sh/compose"
TEMPLATES_ROOT=lab.libreho.st/libre.sh/compose/
## domain handling
### TODO : change to your domain vendor ( ovh , online, )
### CONFIG : change to your domain vendor ( namecheap, ovh , scaleway, )
DOMAIN_SERVER=namecheap
### Namecheap specific
......@@ -18,12 +19,19 @@ NAMECHEAP_URL="namecheap.com"
NAMECHEAP_API_USER="pierreo"
NAMECHEAP_API_KEY=
### ovh specific
### ovh specific (WIP)
OVH_URL="eu.api.ovh.com"
OVH_API_USER=""
OVH_API_KEY=
### Scaleway specific (WIP)
SCALEWAY_URL=""
SCALEWAY_API_USER=""
SCALEWAY_API_KEY=
### TODO : change your settings
IP="curl -s http://icanhazip.com/"
FirstName="Pierre"
LastName="Ozoux"
......@@ -36,16 +44,22 @@ City="Lisbon"
CountryCode="PT"
## Backup
BACKUP_DESTINATION=root@xxxxx:port
### CONFIG : Change your mail settings.
## SMTP
MAIL_USER=
MAIL_PASS=
MAIL_HOST=mail.indie.host
MAIL_PORT=587
### TODO : source a setting file is present to override defaults
echo "-------- Welcome to libre.sh $LIBRE_VERSION installer"
echo "---- sourcing local values.env file if present"
source values.env
# STEP add kernel parameter
......@@ -53,6 +67,18 @@ echo "-------- Welcome to libre.sh $LIBRE_VERSION installer"
echo "-------- setting up system variables"
echo "APP_REPO_URL=${APP_REPO_URL}" >> /etc/environment
echo "LIBRE_VERSION=${LIBRE_VERSION}" >> /etc/environment
echo "MAIL_USER=${MAIL_USER}" >> /etc/environment
echo "MAIL_PASS=${MAIL_PASS}" >> /etc/environment
echo "MAIL_HOST=${MAIL_HOST}" >> /etc/environment
echo "MAIL_PORT=${MAIL_PORT}" >> /etc/environment
# STEP Install Docker
......@@ -98,3 +124,5 @@ cat > /etc/profile.d/libre.sh <<EOF
export PATH=$PATH:/opt/bin
EOF
chmod 644 /etc/profile.d/libre.sh
bash /etc/profile.d/libre.sh
......@@ -103,7 +103,18 @@ function buy_domain_name () {
}
function application () {
git clone https://${arg_a}.git /data/domains/${arg_u}
#We check if a APP_REPO_URL was specified
if [ -z ${APP_REPO_URL:-} ]; then
warning "NO repo URL specified, using argument as full URL"
git_url=https://${arg_a}.git
else
warning "REPO specified, using argument as app name"
git_url=https://${APP_REPO_URL}/${arg_a}.git
fi
git clone ${git_url} /data/domains/${arg_u}
cd /data/domains/${arg_u}
if [ -f ./scripts/install ]; then
export URL=${arg_u}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment