Skip to content

Commit f8671ad

Browse files
committed
chore(wip): bump PostgREST to v13.0.2
1 parent df59fac commit f8671ad

File tree

5 files changed

+24
-73
lines changed

5 files changed

+24
-73
lines changed

ansible/manifest-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
get_url:
2727
url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-ubuntu-aarch64.tar.xz"
2828
dest: /tmp/postgrest-{{ postgrest_release }}-arm64.tar.xz
29-
checksum: "{{ postgrest_arm_release_checksum }}"
29+
checksum: "{{ postgrest_release_checksum }}"
3030
timeout: 60
3131

3232
- name: Download adminapi archive

ansible/tasks/setup-postgrest.yml

Lines changed: 11 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,18 @@
11
- name: PostgREST - system user
22
user: name=postgrest
33

4-
- name: PostgREST - add Postgres PPA gpg key
5-
apt_key:
6-
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
7-
state: present
8-
9-
- name: PostgREST - add Postgres PPA
10-
apt_repository:
11-
repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}"
12-
state: present
13-
14-
- name: PostgREST - update apt cache
15-
apt:
16-
update_cache: yes
17-
18-
# libpq is a C library that enables user programs to communicate with
19-
# the PostgreSQL database server.
20-
- name: PostgREST - system dependencies
21-
apt:
22-
pkg:
23-
- libpq5
24-
- libnuma-dev
25-
26-
- name: PostgREST - remove Postgres PPA gpg key
27-
apt_key:
28-
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
29-
state: absent
30-
31-
- name: PostgREST - remove Postgres PPA
32-
apt_repository:
33-
repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}"
34-
state: absent
35-
36-
- name: postgis - ensure dependencies do not get autoremoved
4+
- name: PostgREST - install from nix postgrest flakes
5+
become: yes
376
shell: |
38-
set -e
39-
apt-mark manual libpq5*
40-
apt-mark manual libnuma*
41-
apt-mark auto libnuma*-dev
42-
43-
- name: PostgREST - download ubuntu binary archive (arm)
44-
get_url:
45-
url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-ubuntu-aarch64.tar.xz"
46-
dest: /tmp/postgrest.tar.xz
47-
checksum: "{{ postgrest_arm_release_checksum }}"
48-
timeout: 60
49-
when: platform == "arm64"
50-
51-
- name: PostgREST - download ubuntu binary archive (x86)
52-
get_url:
53-
url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-linux-static-x64.tar.xz"
54-
dest: /tmp/postgrest.tar.xz
55-
checksum: "{{ postgrest_x86_release_checksum }}"
56-
timeout: 60
57-
when: platform == "amd64"
58-
59-
- name: PostgREST - unpack archive in /opt
60-
unarchive:
61-
remote_src: yes
62-
src: /tmp/postgrest.tar.xz
63-
dest: /opt
64-
owner: postgrest
65-
mode: '0755'
7+
sudo -u postgrest bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install --accept-flake-config github:postgrest/postgrest/v{{ postgrest_release }}"
8+
when: stage2_nix
9+
10+
- name: Create symlink for PostgREST from Nix profile to /opt
11+
ansible.builtin.file:
12+
src: /home/postgrest/.nix-profile/bin/postgrest
13+
dest: /opt/postgrest
14+
state: link
15+
force: yes # This will replace existing file/symlink if it exists
6616

6717
- name: create directories
6818
file:

ansible/vars.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@ postgres_major:
99

1010
# Full version strings for each major version
1111
postgres_release:
12-
postgresorioledb-17: "17.0.1.092-orioledb"
13-
postgres17: "17.4.1.042"
14-
postgres15: "15.8.1.099"
12+
postgresorioledb-17: "17.0.1.092-orioledb-pgrst13"
13+
postgres17: "17.4.1.042-pgrst13"
14+
postgres15: "15.8.1.099-pgrst13"
1515

1616
# Non Postgres Extensions
1717
pgbouncer_release: "1.19.0"
1818
pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e2ccef2ca59e3d8ce682
1919

20-
# to get these use
21-
# wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-ubuntu-aarch64.tar.xz -q -O- | sha1sum
22-
# wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-linux-static-x64.tar.xz -q -O- | sha1sum
23-
postgrest_release: "12.2.3"
24-
postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9
25-
postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05
20+
# to get the checksum use
21+
# wget https://github.com/PostgREST/postgrest/releases/download/v13.0.2/postgrest-v13.0.2-ubuntu-aarch64.tar.xz -q -O- | sha1sum
22+
postgrest_release: "13.0.2"
23+
postgrest_release_checksum: sha1:ea184ea392544b8374c1c21bbe278f55959ae62a
2624

2725
gotrue_release: 2.175.0
2826
gotrue_release_checksum: sha1:4e2a41e08936195daf443c60201691c1bd991709

scripts/nix-provision.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function install_packages {
2424

2525
function install_nix() {
2626
sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
27-
--extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \
28-
--extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root
27+
--extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com https://postgrest.cachix.org\" \
28+
--extra-conf \"trusted-public-keys = postgrest.cachix.org-1:icgW4R15fz1+LqvhPjt4EnX/r19AaqxiVV+1olwlZtI= nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root
2929
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
3030

3131
}

testinfra/test_ami_nix.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ def gzip_then_base64_encode(s: str) -> str:
309309
sleep(5)
310310
instance.reload()
311311

312+
print('---------------- InstanceID: ----------------')
313+
print('---------------- ', instance.id)
314+
312315
# Create single SSH connection
313316
ssh = get_ssh_connection(
314317
instance.public_ip_address,

0 commit comments

Comments
 (0)