Skip to content

Commit

Permalink
Use PROVIDER_LOCAL when DEVELOP env is set (#97)
Browse files Browse the repository at this point in the history
* Use PROVIDER_LOCAL when DEVELOP env is set

It doesn't make much sense determining provider in this case.
Also it will make it possible to run spilo as standalone app on AWS with
for example jenkins.

* Fix postgis version to 2.3, otherwise build fails
  • Loading branch information
CyberDem0n committed Oct 13, 2016
1 parent 70cde8c commit 3f8741e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
# Install PostgreSQL binaries, contrib, pgq, plproxy, pgq and multiple pl's
apt-get install -y postgresql-${version} postgresql-${version}-dbg postgresql-client-${version} \
postgresql-contrib-${version} postgresql-${version}-plproxy postgresql-${version}-pgq3 \
postgresql-${version}-postgis postgresql-plpython3-${version} \
postgresql-${version}-postgis-2.3 postgresql-plpython3-${version} \
postgresql-plpython-${version} postgresql-${version}-plr postgresql-pltcl-${version} \
postgresql-${version}-plv8 postgresql-${version}-pllua postgresql-plperl-${version} \
# Remove the default cluster, which Debian stupidly starts right after installation of the packages
Expand Down
12 changes: 7 additions & 5 deletions postgres-appliance/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def write_wale_command_environment(placeholders, overwrite, provider):
if match:
region = match.group(1)
else:
region = get_instance_meta_data('placement/availability-zone')[:-1]
region = get_instance_metadata('placement/availability-zone')[:-1]
write_file('https+path://s3-{}.amazonaws.com:443'.format(region),
os.path.join(placeholders['WALE_ENV_DIR'], 'WALE_S3_ENDPOINT'), overwrite)
elif provider == PROVIDER_GOOGLE:
Expand Down Expand Up @@ -450,11 +450,13 @@ def main():
if os.environ.get('PATRONIVERSION') < '1.0':
raise Exception('Patroni version >= 1.0 is required')

provider = get_provider()
placeholders = get_placeholders(provider)

if os.environ.get('DEVELOP', '') in ['1', 'true', 'on', 'ON']:
if os.environ.get('DEVELOP', '').lower() in ['1', 'true', 'on']:
write_etcd_configuration(placeholders)
provider = PROVIDER_LOCAL
else:
provider = get_provider()

placeholders = get_placeholders(provider)

config = yaml.load(pystache_render(TEMPLATE, placeholders))
config.update(get_dcs_config(config, placeholders))
Expand Down

0 comments on commit 3f8741e

Please sign in to comment.