8000 Install pg_jsonschema v0.1.0 (#254) · rickengineering/postgres@36e6502 · GitHub
[go: up one dir, main page]

Skip to content

Commit 36e6502

Browse files
oliricedragarcia
andauthored
Install pg_jsonschema v0.1.0 (supabase#254)
* install pg_jsonschema v0.1.0 * tabs to spaces * Update ansible/tasks/postgres-extensions/21-pg_jsonschema.yml Co-authored-by: dragarcia <Angelico.delosreyes@gmail.com> * Update ansible/tasks/postgres-extensions/21-pg_jsonschema.yml Co-authored-by: dragarcia <Angelico.delosreyes@gmail.com> * remove and ignore swp files * pg_jsonschema task 21 -> 22 * bump img version * remaining steps - ensure certain steps are run by the postgres Linux user - temporarily grant ownership for certain directories to the postgres Linux user Co-authored-by: dragarcia <Angelico.delosreyes@gmail.com>
1 parent bcea35d commit 36e6502

File tree

5 files changed

+70
-1
lines changed

5 files changed

+70
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
.python-version
33
venv/
4+
*.swp
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# pg_jsonschema
2+
- name: pg_jsonschema - download & install dependencies
3+
apt:
4+
pkg:
5+
- make
6+
- gcc
7+
- pkg-config
8+
- clang
9+
- libssl-dev
10+
update_cache: yes
11+
install_recommends: no
12+
13+
- name: download rust/cargo installer
14+
become: yes
15+
get_url:
16+
url: https://sh.rustup.rs
17+
dest: /tmp/sh.rustup.rs
18+
mode: '0755'
19+
owner: postgres
20+
group: postgres
21+
22+
- name: install rust/cargo
23+
become: yes
24+
become_user: postgres
25+
shell: /tmp/sh.rustup.rs -y
26+
27+
- name: install cargo-pgx
28+
become: yes
29+
become_user: postgres
30+
shell:
31+
cmd: "~/.cargo/bin/cargo install --version '={{ pgx_version }}' cargo-pgx && ~/.cargo/bin/cargo pgx init --pg{{ postgresql_major }} pg_config"
32+
33+
- name: pg_jsonschema - download release
34+
become: yes
35+
git:
36+
repo: https://github.com/supabase/pg_jsonschema.git
37+
dest: /tmp/pg_jsonschema
38+
version: "{{ pg_jsonschema_release }}"
39+
40+
- name: pg_jsonschema - temporarily transfer ownership to postgres
41+
file:
42+
path: '{{ item }}'
43+
recurse: yes
44+
owner: postgres
45+
group: postgres
46+
with_items:
47+
- /tmp/pg_jsonschema
48+
- /usr/lib/postgresql/lib
49+
50+
- name: pg_jsonschema - install
51+
become: yes
52+
become_user: postgres
53+
shell:
54+
cmd: "~/.cargo/bin/cargo pgx install --release"
55+
chdir: /tmp/pg_jsonschema
56+
57+
- name: pg_jsonschema - return ownership to root
58+
file:
59+
path: /usr/lib/postgresql/lib
60+
recurse: yes
61+
owner: root
62+
group: root

ansible/tasks/setup-extensions.yml

Expand all lines: ansible/tasks/setup-extensions.yml
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@
6060

6161
- name: Install auto_explain
6262
import_tasks: tasks/postgres-extensions/21-auto_explain.yml
63+
64+
- name: Install pg_jsonschema
65+
import_tasks: tasks/postgres-extensions/22-pg_jsonschema.yml

ansible/vars.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,7 @@ libgraphqlparser_commit_sha: 3b64cd52d13621921990a5801ba019e8a9402599
108108

109109
pg_graphql_release: "v0.4.0"
110110

111+
pgx_version: "0.4.5"
112+
pg_jsonschema_release: "v0.1.0"
113+
111114
pg_stat_monitor_release: "1.0.1"

common.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "14.1.0.50"
1+
postgres-version = "14.1.0.51"

0 commit comments

Comments
 (0)
0