Skip to content

Commit

Permalink
chore: share ansible vars with docker build (#529)
Browse files Browse the repository at this point in the history
* Update dockerhub-release.yml

* chore: add multistage docker build

* chore: update test dockerfile

* chore: run build on every pr

* chore: update postgresql config for extensions

* chore: install vault extension

* chore: install plv8

* Revert "Update dockerhub-release.yml"

This reverts commit 46a2d45.

* chore: add initial migration files

* chore: use labs syntax for checksum and git ref

* chore: use ccache to build plv8

* chore: share ansible vars with docker build

* chore: remove empty line

* chore: update more checksums for consistency

* chore: remove checksum from dockerfile

* chore: bump version to rc1
  • Loading branch information
sweatybridge authored Feb 8, 2023
1 parent 601c3bb commit 5a462da
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 53 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
POSTGRES_PASSWORD: password
steps:
- uses: actions/checkout@v3
- id: args
uses: mikefarah/yq@master
with:
cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join(" ")' 'ansible/vars.yml'
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v3
with:
Expand Down
26 changes: 1 addition & 25 deletions ansible/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,35 @@ ARG postgres_major=15
ARG postgres_minor=1

ARG sfcgal_release=1.3.10
ARG sfcgal_release_checksum=sha256:4e39b3b2adada6254a7bdba6d297bb28e1a9835a9f879b74f37e2dab70203232
ARG postgis_release=3.3.2
ARG postgis_release_checksum=sha256:9a2a219da005a1730a39d1959a1c7cec619b1efb009b65be80ffc25bad299068
ARG pgrouting_release=3.4.1
ARG pgrouting_release_checksum=sha256:a4e034efee8cf67582b67033d9c3ff714a09d8f5425339624879df50aff3f642
ARG pgtap_release=1.2.0
ARG pgtap_release_checksum=sha256:9c7c3de67ea41638e14f06da5da57bac6f5bd03fea05c165a0ec862205a5c052
ARG pg_cron_release=1.4.2
ARG pg_cron_release_checksum=sha256:3652722ea98d94d8e27bf5e708dd7359f55a818a43550d046c5064c98876f1a8
ARG pgaudit_release=1.7.0
ARG pgaudit_release_checksum=sha256:8f4a73e451c88c567e516e6cba7dc1e23bc91686bb6f1f77f8f3126d428a8bd8
ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9
ARG pgsql_http_release=1.5.0
ARG pgsql_http_release_checksum=sha256:43efc9e82afcd110f205b86b8d28d1355d39b6b134161e9661a33a1346818f5d
ARG plpgsql_check_release=2.2.5
ARG plpgsql_check_release_checksum=sha256:6c3a3c5faf3f9689425c6db8a6b20bf4cd5e7144a055e29538eae980c7232573
ARG pg_safeupdate_release=1.4
ARG pg_safeupdate_release_checksum=sha256:ff01d3d444d35924bd3d745c5695696292e2855042da4c30fe728fb3b6648122
ARG timescaledb_release=2.9.1
ARG timescaledb_release_checksum=sha256:883638f2e79d25ec88ee58f603f3c81c999b6364cb4c799919d363f04089b47b
ARG wal2json_release=2_5
ARG wal2json_release_checksum=sha256:b516653575541cf221b99cf3f8be9b6821f6dbcfc125675c85f35090f824f00e
ARG pljava_release=1.6.4
ARG pljava_release_checksum=sha256:5dc5a963365cbdeb786d0ad65b6310c4c5150ef8524e273bca4085c3fb0f056f
ARG plv8_release=3.1.5
ARG plv8_release_checksum=sha256:1e108d5df639e4c189e1c5bdfa2432a521c126ca89e7e5a969d46899ca7bf106
ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492
ARG pg_net_release=0.7.1
ARG pg_net_release_checksum=sha256:f403019fbffe5b3ec28816957ef81279dea1db5b008e3fb3bc39181a5e361940
ARG rum_release=1.3.13
ARG rum_release_checksum=sha256:6ab370532c965568df6210bd844ac6ba649f53055e48243525b0b7e5c4d69a7d
ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6
ARG libsodium_release=1.0.18
ARG libsodium_release_checksum=sha256:6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
ARG pgsodium_release=3.1.5
ARG pgsodium_release_checksum=sha256:bec847388a5db2a60ea9d991962ce27954d91b4c41cbcc7bd8e34472c69114d1
ARG pg_graphql_release=1.1.0
ARG pg_stat_monitor_release=1.1.1
ARG pg_stat_monitor_release_checksum=sha256:1756a02d5a6dd66b892d15920257c69a17a67d48d3d4e2f189b681b83001ec2a
ARG pg_jsonschema_release=0.1.4
ARG vault_release=0.2.9
ARG vault_release_checksum=sha256:1e813216395c59bb94c92be47ce8b70ba19ccc0efbcdb1fb14ed6d34a42c6cdb
ARG vault_release=0.2.8
ARG groonga_release=12.0.8
ARG groonga_release_checksum=sha256:7770c0ff6804ef4b47b015b15736cd973cffced977c20991b16b2daa4fea6eeb
ARG pgroonga_release=2.4.0
ARG pgroonga_release_checksum=sha256:5baaae0e7d81f8167e278e9a34c6ed56aece8b34f5ab98f228c64408093417b3
ARG wrappers_release=0.1.7
ARG hypopg_release=1.3.1
ARG hypopg_release_checksum=sha256:e7f01ee0259dc1713f318a108f987663d60f3041948c2ada57a94b469565ca8e
ARG pg_repack_release=1.4.8
ARG pg_repack_release_checksum=sha256:18b4d871c1abf78cf0b1b1fe6081d435d183a8dc5eb977576e7a47fe113dd4ec
ARG pgvector_release=0.4.0
ARG pgvector_release_checksum=sha256:b76cf84ddad452cc880a6c8c661d137ddd8679c000a16332f4f03ecf6e10bcc8

FROM postgres:$postgres_major.$postgres_minor as base
# Redeclare args for use in subsequent stages
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/06-pgjwt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git:
repo: https://github.com/michelp/pgjwt.git
dest: /tmp/pgjwt
version: master
version: "{{ pgjwt_release }}"

- name: pgjwt - install
make:
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/11-wal2json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git:
repo: https://github.com/eulerto/wal2json.git
dest: /tmp/wal2json
version: "{{ wal2json_commit_sha }}"
version: "wal2json_{{ wal2json_release }}"

- name: wal2json - install
make:
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/13-plv8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
git:
repo: https://github.com/plv8/plv8.git
dest: /tmp/plv8
version: "{{ plv8_commit_version }}"
version: "{{ plv8_release }}"
become: yes

- name: Create a symbolic link
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/14-pg_plan_filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git:
repo: https://github.com/pgexperts/pg_plan_filter.git
dest: /tmp/pg_plan_filter
version: "{{ pg_plan_filter_commit_version }}"
version: "{{ pg_plan_filter_release }}"
become: yes

- name: pg_plan_filter - build
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/17-pg_hashids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git:
repo: https://github.com/iCyberon/pg_hashids.git
dest: /tmp/pg_hashids
version: master
version: "{{ pg_hashids_release }}"

- name: pg_hashids - build
make:
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/19-pg_graphql.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- name: install pg_graphql
ansible.builtin.apt:
deb: "https://github.com/supabase/pg_graphql/releases/download/{{ pg_graphql_release }}/pg_graphql-{{ pg_graphql_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb"
deb: "https://github.com/supabase/pg_graphql/releases/download/v{{ pg_graphql_release }}/pg_graphql-v{{ pg_graphql_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb"
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/22-pg_jsonschema.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- name: install pg_jsonschema
ansible.builtin.apt:
deb: "https://github.com/supabase/pg_jsonschema/releases/download/{{ pg_jsonschema_release }}/pg_jsonschema-{{ pg_jsonschema_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb"
deb: "https://github.com/supabase/pg_jsonschema/releases/download/v{{ pg_jsonschema_release }}/pg_jsonschema-v{{ pg_jsonschema_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb"
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/25-wrappers.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- name: install wrappers
ansible.builtin.apt:
deb: "https://github.com/supabase/wrappers/releases/download/{{ wrappers_release }}/wrappers-{{ wrappers_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb"
deb: "https://github.com/supabase/wrappers/releases/download/v{{ wrappers_release }}/wrappers-v{{ wrappers_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb"
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/26-hypopg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git:
repo: https://github.com/HypoPG/hypopg.git
dest: /tmp/hypopg
version: "{{ hypopg_commit_sha }}"
version: "{{ hypopg_release }}"

- name: hypopg - install
make:
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/postgres-extensions/28-pgvector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git:
repo: https://github.com/pgvector/pgvector.git
dest: /tmp/pgvector
version: '{{ pgvector_release }}'
version: 'v{{ pgvector_release }}'
become: yes

- name: pgvector - build
Expand Down
44 changes: 27 additions & 17 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ nginx_release_checksum: sha1:419efb77b80f165666e2ee406ad8ae9b845aba93
wal_g_release: "v2.0.1"

sfcgal_release: "1.3.10"
sfcgal_release_checksum: sha1:f4add34a00afb0b5f594685fc646565a2bda259b
sfcgal_release_checksum: sha256:4e39b3b2adada6254a7bdba6d297bb28e1a9835a9f879b74f37e2dab70203232

postgres_exporter_release: "0.9.0"
postgres_exporter_release_checksum:
Expand All @@ -60,64 +60,74 @@ pg_cron_release_checksum: sha256:3652722ea98d94d8e27bf5e708dd7359f55a818a43550d0
pgaudit_release: "1.7.0"
pgaudit_release_checksum: sha256:8f4a73e451c88c567e516e6cba7dc1e23bc91686bb6f1f77f8f3126d428a8bd8

pgjwt_release: 9742dab1b2f297ad3811120db7b21451bca2d3c9

pgsql_http_release: "1.5.0"
pgsql_http_release_checksum: sha256:43efc9e82afcd110f205b86b8d28d1355d39b6b134161e9661a33a1346818f5d

plpgsql_check_release: "2.2.5"
plpgsql_check_release_checksum: sha256:6c3a3c5faf3f9689425c6db8a6b20bf4cd5e7144a055e29538eae980c7232573

pg_safeupdate_release: "1.4"
pg_safeupdate_release_checksum: sha1:942dacd0ebce6123944212ffb3d6b5a0c09174f9
pg_safeupdate_release_checksum: sha256:ff01d3d444d35924bd3d745c5695696292e2855042da4c30fe728fb3b6648122

timescaledb_release: "2.9.1"
timescaledb_release_checksum: sha256:883638f2e79d25ec88ee58f603f3c81c999b6364cb4c799919d363f04089b47b

wal2json_commit_sha: 770872b890f9e122290f178e7c7bfa19ec7afa94
wal2json_release: "2_5"
wal2json_release_checksum: sha256:b516653575541cf221b99cf3f8be9b6821f6dbcfc125675c85f35090f824f00e

supautils_release: "1.7.0"
supautils_release_checksum: sha256:e2353040262bd7a1720099f4a03ec485b05c74a202956aa1361e422f8765c6b3

pljava_release: "a5bfeca83cea2c4b844758a9c76db337392892e3"
pljava_release_checksum: sha1:550bea791c404c9d62050fd9c330e162bab20763
pljava_release: master
pljava_release_checksum: sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6

plv8_commit_version: bcddd92f71530e117f2f98b92d206dafe824f73a
plv8_release: "3.1.5"
plv8_release_checksum: sha256:1e108d5df639e4c189e1c5bdfa2432a521c126ca89e7e5a969d46899ca7bf106

pg_plan_filter_commit_version: 5081a7b5cb890876e67d8e7486b6a64c38c9a492
pg_plan_filter_release: 5081a7b5cb890876e67d8e7486b6a64c38c9a492

pg_net_release: "0.7.1"
pg_net_release_checksum: sha1:1df576745a320b6faa78cff5067cad9bdd4cfbcb
pg_net_release_checksum: sha256:f403019fbffe5b3ec28816957ef81279dea1db5b008e3fb3bc39181a5e361940

rum_release: "1.3.13"
rum_release_checksum: sha256:6ab370532c965568df6210bd844ac6ba649f53055e48243525b0b7e5c4d69a7d

pg_hashids_release: cd0e1b31d52b394a0df64079406a14a4f7387cd6

vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb"
vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb"

libsodium_release: "1.0.18"
libsodium_release_checksum: sha1:795b73e3f92a362fabee238a71735579bf46bb97
libsodium_release_checksum: sha256:6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1

pgsodium_release: "3.1.5"
pgsodium_release_checksum: sha256:bec847388a5db2a60ea9d991962ce27954d91b4c41cbcc7bd8e34472c69114d1

pg_graphql_release: "v1.1.0"
pg_graphql_release: "1.1.0"

pg_jsonschema_release: "v0.1.4"
pg_jsonschema_release: "0.1.4"

pg_stat_monitor_release: "1.1.1"
pg_stat_monitor_release_checksum: sha256:1756a02d5a6dd66b892d15920257c69a17a67d48d3d4e2f189b681b83001ec2a

vault_release: "0.2.8"
vault_release_checksum: sha256:842cdee6d5b586b1baacccfaa08b45d56566987af87952a5fe5ee80b24400754

groonga_release: "12.0.8"
groonga_release_checksum: sha1:32aee787efffc2a22760fde946fb6462286074e2
groonga_release_checksum: sha256:7770c0ff6804ef4b47b015b15736cd973cffced977c20991b16b2daa4fea6eeb

pgroonga_release: "2.4.0"
pgroonga_release_checksum: sha1:235d67e8487b318e656d4d3016a49c14fae0512d
pgroonga_release_checksum: sha256:5baaae0e7d81f8167e278e9a34c6ed56aece8b34f5ab98f228c64408093417b3

wrappers_release: "v0.1.7"
wrappers_release: "0.1.7"

hypopg_commit_sha: 57d711bc4e37164c8edac81580a5f477e2a33d86
hypopg_release: "1.3.1"
hypopg_release_checksum: sha256:e7f01ee0259dc1713f318a108f987663d60f3041948c2ada57a94b469565ca8e

pg_repack_release: "1.4.8"
pg_repack_release_checksum: sha1:74e54f43f6c062644e442224eacc2a2bc95a04ef
pg_repack_release_checksum: sha256:18b4d871c1abf78cf0b1b1fe6081d435d183a8dc5eb977576e7a47fe113dd4ec

pgvector_release: "v0.4.0"
pgvector_release: "0.4.0"
pgvector_release_checksum: sha256:b76cf84ddad452cc880a6c8c661d137ddd8679c000a16332f4f03ecf6e10bcc8
2 changes: 1 addition & 1 deletion common.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.1.0.38"
postgres-version = "15.1.0.39-rc1"

0 comments on commit 5a462da

Please sign in to comment.