Skip to content

Commit

Permalink
fabfile: add both prod machines
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Aage Lavik <[email protected]>
  • Loading branch information
jalavik committed Nov 18, 2014
1 parent 90ceaf4 commit 766ed5a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
env.conf_directory = "/afs/cern.ch/project/inspire/repo/inspire-configuration.git"

env.roledefs = {
'prod': ['inspirelabsvm01'],
'prod': ['inspirelabsvm01', 'inspirelabsvm02'],
'dev01': ['inspirevm08.cern.ch'],
'dev02': ['inspirevm11.cern.ch'],
}
Expand All @@ -22,8 +22,8 @@
def prod():
"""Activate configuration for INSPIRE PROD server."""
env.roles = ['prod']
env.site_url = "http://inspirelabsvm01.cern.ch"
env.site_secure_url = "https://inspirelabsvm01.cern.ch"
env.site_url = "http://{0}.cern.ch"
env.site_secure_url = "https://{0}.cern.ch"
env.conf_branch = "prod"


Expand Down Expand Up @@ -115,8 +115,14 @@ def install():
prefix_folder = prefix_folder.split("\n")
sudo("pybabel compile -fd {0}/base/translations".format(prefix_folder[-1]))
# Set Flask Host configuration
sudo("inveniomanage config set CFG_SITE_URL {0}".format(env.site_url))
sudo("inveniomanage config set CFG_SITE_SECURE_URL {0}".format(env.site_secure_url))
if "{0}" in env.site_url:
url = env.site_url.format(env.host)
secure_url = env.site_secure_url.format(env.host)
else:
url = env.site_url
secure_url = env.site_secure_url
sudo("inveniomanage config set CFG_SITE_URL {0}".format(url))
sudo("inveniomanage config set CFG_SITE_SECURE_URL {0}".format(secure_url))
# Create Apache configuration
sudo("inveniomanage apache create-config")
sudo("rm /opt/invenio")
Expand Down

0 comments on commit 766ed5a

Please sign in to comment.