Prepare deployment tools #2

Closed
opened 2021-10-13 07:42:55 +13:00 by danalambert · 7 comments
danalambert commented 2021-10-13 07:42:55 +13:00 (Migrated from gitlab.catalyst.net.nz)
No description provided.
danalambert commented 2021-11-08 15:20:44 +13:00 (Migrated from gitlab.catalyst.net.nz)

Note to self:

CORS_ALLOWED_ORIGINS = [
    'http://localhost:3000' # Update this for production
]
Note to self: ``` CORS_ALLOWED_ORIGINS = [ 'http://localhost:3000' # Update this for production ] ```
alistairmcintyre commented 2021-11-09 14:41:54 +13:00 (Migrated from gitlab.catalyst.net.nz)

We should start thinking about what this looks like - is this the last step? As in hand over?

We should start thinking about what this looks like - is this the last step? As in hand over?
danalambert commented 2021-11-10 11:35:21 +13:00 (Migrated from gitlab.catalyst.net.nz)

Ideally, we have this up and running asap really. We have access to their Catalyst cloud account now.

Ideally, we have this up and running asap really. We have access to their Catalyst cloud account now.
danalambert commented 2021-11-10 14:19:32 +13:00 (Migrated from gitlab.catalyst.net.nz)

assigned to @danalambert

assigned to @danalambert
danalambert commented 2021-11-10 17:38:16 +13:00 (Migrated from gitlab.catalyst.net.nz)

mentioned in merge request !21

mentioned in merge request !21
danalambert commented 2021-11-16 10:40:16 +13:00 (Migrated from gitlab.catalyst.net.nz)

@alistairmcintyre re CREATE DATABASE IF NOT EXISTS...:
The current output is

postgres    | 
postgres    | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres    | 
postgres    | 2021-11-15 21:28:13.897 UTC [1] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
postgres    | 2021-11-15 21:28:13.897 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres    | 2021-11-15 21:28:13.897 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres    | 2021-11-15 21:28:13.926 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres    | 2021-11-15 21:28:13.946 UTC [26] LOG:  database system was shut down at 2021-11-15 21:28:13 UTC
postgres    | 2021-11-15 21:28:13.953 UTC [1] LOG:  database system is ready to accept connections

so it appears it recognises the database exists and doesn't do anything. Alternately, there appear to be ways of checking if the database exists in the script using the following, but this still produces the output above.

CREATE DATABASE IF NOT right_tree;
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'right_tree')\gexec

Overall, this seems like a non-issue if it recognises the database creation already, what do you reckon @alistairmcintyre ? If so I'll just leave that script the way it was without the check.

@alistairmcintyre re `CREATE DATABASE IF NOT EXISTS...`: The current output is ```bash postgres | postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres | postgres | 2021-11-15 21:28:13.897 UTC [1] LOG: starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit postgres | 2021-11-15 21:28:13.897 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres | 2021-11-15 21:28:13.897 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres | 2021-11-15 21:28:13.926 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres | 2021-11-15 21:28:13.946 UTC [26] LOG: database system was shut down at 2021-11-15 21:28:13 UTC postgres | 2021-11-15 21:28:13.953 UTC [1] LOG: database system is ready to accept connections ``` so it appears it recognises the database exists and doesn't do anything. Alternately, there appear to be ways of checking if the database exists in the script using the following, but this still produces the output above. ```sql CREATE DATABASE IF NOT right_tree; WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'right_tree')\gexec ``` Overall, this seems like a non-issue if it recognises the database creation already, what do you reckon @alistairmcintyre ? If so I'll just leave that script the way it was without the check.
danalambert commented 2021-11-16 17:33:08 +13:00 (Migrated from gitlab.catalyst.net.nz)

See branch https://gitlab.catalyst.net.nz/giscore/biosphere-capital/right-tree/-/tree/dana/production-build

Waiting to get access to Wilfred's Catalyst Cloud instance, the previous link expired.

See branch https://gitlab.catalyst.net.nz/giscore/biosphere-capital/right-tree/-/tree/dana/production-build Waiting to get access to Wilfred's Catalyst Cloud instance, the previous link expired.
stephenj (Migrated from gitlab.catalyst.net.nz) closed this issue 2021-11-30 14:09:50 +13:00
Sign in to join this conversation.
No description provided.