From 4e3be36c7d1664ddbf780dc2d5237cef67bf21b8 Mon Sep 17 00:00:00 2001 From: Sergei Zaychenko Date: Tue, 2 Jul 2024 02:07:35 -0700 Subject: [PATCH] v0.189.3 SQLX images now include scripts and programs necessary to fetch database credentials from AWS secrets manager (#694) * v0.189.3 SQLX images now include scripts and programs necessary to fetch database credentials from AWS secrets manager * Moved scripts and programs to image with migrations * Enable pipefile mode --- CHANGELOG.md | 4 + Cargo.lock | 162 +++++++++--------- Cargo.toml | 90 +++++----- LICENSE.txt | 2 +- images/sqlx-cli-with-migrations/Dockerfile | 13 ++ .../scripts/fetch-db-secret.sh | 23 +++ .../scripts/run-db-migrations.sh | 17 ++ 7 files changed, 184 insertions(+), 127 deletions(-) create mode 100644 images/sqlx-cli-with-migrations/scripts/fetch-db-secret.sh create mode 100644 images/sqlx-cli-with-migrations/scripts/run-db-migrations.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a50ff1d92..7c58fe2bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.189.3] - 2024-07-02 +### Fixed +- SQLX images now include scripts and programs necessary to fetch database credentials from AWS secrets manager + ## [0.189.2] - 2024-07-01 ### Fixed - AWS secret stores both user name and password, so database username should be a secret too. diff --git a/Cargo.lock b/Cargo.lock index 0831c68240..0cd78b9af7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -319,9 +319,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", @@ -2057,9 +2057,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.101" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" dependencies = [ "jobserver", "libc", @@ -2169,9 +2169,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -2179,9 +2179,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -2191,18 +2191,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.6" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" +checksum = "1d598e88f6874d4b888ed40c71efbcbf4076f1dfbae128a08a8c9e45f710605d" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2320,7 +2320,7 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "container-runtime" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "cfg-if", @@ -2719,7 +2719,7 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "database-common" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "aws-config", @@ -3476,7 +3476,7 @@ dependencies = [ [[package]] name = "enum-variants" -version = "0.189.2" +version = "0.189.3" [[package]] name = "env_filter" @@ -3538,7 +3538,7 @@ dependencies = [ [[package]] name = "event-bus" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "dill", @@ -3559,7 +3559,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-sourcing" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "event-sourcing-macros" -version = "0.189.2" +version = "0.189.3" dependencies = [ "quote", "syn 2.0.68", @@ -4282,9 +4282,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", @@ -4324,7 +4324,7 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "rustls 0.23.10", "rustls-native-certs 0.7.0", @@ -4348,16 +4348,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.4.0", "pin-project-lite", "socket2", "tokio", @@ -4545,7 +4545,7 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "internal-error" -version = "0.189.2" +version = "0.189.3" dependencies = [ "thiserror", ] @@ -4702,7 +4702,7 @@ dependencies = [ [[package]] name = "kamu" -version = "0.189.2" +version = "0.189.3" dependencies = [ "alloy", "async-recursion", @@ -4785,7 +4785,7 @@ dependencies = [ [[package]] name = "kamu-accounts" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "base32", @@ -4810,7 +4810,7 @@ dependencies = [ [[package]] name = "kamu-accounts-inmem" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -4828,7 +4828,7 @@ dependencies = [ [[package]] name = "kamu-accounts-mysql" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -4848,7 +4848,7 @@ dependencies = [ [[package]] name = "kamu-accounts-postgres" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -4868,7 +4868,7 @@ dependencies = [ [[package]] name = "kamu-accounts-repo-tests" -version = "0.189.2" +version = "0.189.3" dependencies = [ "argon2", "chrono", @@ -4883,7 +4883,7 @@ dependencies = [ [[package]] name = "kamu-accounts-services" -version = "0.189.2" +version = "0.189.3" dependencies = [ "argon2", "async-trait", @@ -4909,7 +4909,7 @@ dependencies = [ [[package]] name = "kamu-accounts-sqlite" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -4929,7 +4929,7 @@ dependencies = [ [[package]] name = "kamu-adapter-auth-oso" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "dill", @@ -4949,7 +4949,7 @@ dependencies = [ [[package]] name = "kamu-adapter-flight-sql" -version = "0.189.2" +version = "0.189.3" dependencies = [ "arrow-flight", "async-trait", @@ -4972,7 +4972,7 @@ dependencies = [ [[package]] name = "kamu-adapter-graphql" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-graphql", "async-trait", @@ -5017,7 +5017,7 @@ dependencies = [ [[package]] name = "kamu-adapter-http" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "aws-sdk-s3", @@ -5070,7 +5070,7 @@ dependencies = [ [[package]] name = "kamu-adapter-oauth" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -5090,7 +5090,7 @@ dependencies = [ [[package]] name = "kamu-adapter-odata" -version = "0.189.2" +version = "0.189.3" dependencies = [ "axum", "chrono", @@ -5120,7 +5120,7 @@ dependencies = [ [[package]] name = "kamu-cli" -version = "0.189.2" +version = "0.189.3" dependencies = [ "arrow-flight", "assert_cmd", @@ -5219,7 +5219,7 @@ dependencies = [ [[package]] name = "kamu-cli-e2e-common" -version = "0.189.2" +version = "0.189.3" dependencies = [ "indoc 2.0.5", "internal-error", @@ -5237,7 +5237,7 @@ dependencies = [ [[package]] name = "kamu-cli-e2e-inmem" -version = "0.189.2" +version = "0.189.3" dependencies = [ "indoc 2.0.5", "kamu-cli-e2e-common", @@ -5249,7 +5249,7 @@ dependencies = [ [[package]] name = "kamu-cli-e2e-mysql" -version = "0.189.2" +version = "0.189.3" dependencies = [ "indoc 2.0.5", "kamu-cli-e2e-common", @@ -5262,7 +5262,7 @@ dependencies = [ [[package]] name = "kamu-cli-e2e-postgres" -version = "0.189.2" +version = "0.189.3" dependencies = [ "indoc 2.0.5", "kamu-cli-e2e-common", @@ -5275,7 +5275,7 @@ dependencies = [ [[package]] name = "kamu-cli-e2e-repo-tests" -version = "0.189.2" +version = "0.189.3" dependencies = [ "chrono", "indoc 2.0.5", @@ -5288,7 +5288,7 @@ dependencies = [ [[package]] name = "kamu-cli-e2e-sqlite" -version = "0.189.2" +version = "0.189.3" dependencies = [ "indoc 2.0.5", "kamu-cli-e2e-common", @@ -5301,7 +5301,7 @@ dependencies = [ [[package]] name = "kamu-core" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5329,7 +5329,7 @@ dependencies = [ [[package]] name = "kamu-data-utils" -version = "0.189.2" +version = "0.189.3" dependencies = [ "arrow", "arrow-digest", @@ -5354,7 +5354,7 @@ dependencies = [ [[package]] name = "kamu-datafusion-cli" -version = "0.189.2" +version = "0.189.3" dependencies = [ "arrow", "async-trait", @@ -5376,7 +5376,7 @@ dependencies = [ [[package]] name = "kamu-flow-system" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -5401,7 +5401,7 @@ dependencies = [ [[package]] name = "kamu-flow-system-inmem" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5428,7 +5428,7 @@ dependencies = [ [[package]] name = "kamu-flow-system-postgres" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5451,7 +5451,7 @@ dependencies = [ [[package]] name = "kamu-flow-system-repo-tests" -version = "0.189.2" +version = "0.189.3" dependencies = [ "chrono", "dill", @@ -5462,7 +5462,7 @@ dependencies = [ [[package]] name = "kamu-flow-system-services" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5500,7 +5500,7 @@ dependencies = [ [[package]] name = "kamu-flow-system-sqlite" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5523,7 +5523,7 @@ dependencies = [ [[package]] name = "kamu-ingest-datafusion" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -5560,7 +5560,7 @@ dependencies = [ [[package]] name = "kamu-repo-tools" -version = "0.189.2" +version = "0.189.3" dependencies = [ "chrono", "clap", @@ -5575,7 +5575,7 @@ dependencies = [ [[package]] name = "kamu-task-system" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -5590,7 +5590,7 @@ dependencies = [ [[package]] name = "kamu-task-system-inmem" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-trait", "chrono", @@ -5605,7 +5605,7 @@ dependencies = [ [[package]] name = "kamu-task-system-postgres" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5627,7 +5627,7 @@ dependencies = [ [[package]] name = "kamu-task-system-repo-tests" -version = "0.189.2" +version = "0.189.3" dependencies = [ "chrono", "dill", @@ -5638,7 +5638,7 @@ dependencies = [ [[package]] name = "kamu-task-system-services" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -5657,7 +5657,7 @@ dependencies = [ [[package]] name = "kamu-task-system-sqlite" -version = "0.189.2" +version = "0.189.3" dependencies = [ "async-stream", "async-trait", @@ -6046,9 +6046,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -6143,7 +6143,7 @@ dependencies = [ [[package]] name = "multiformats" -version = "0.189.2" +version = "0.189.3" dependencies = [ "bs58", "digest 0.10.7", @@ -6407,9 +6407,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -6426,7 +6426,7 @@ dependencies = [ "chrono", "futures", "humantime", - "hyper 1.3.1", + "hyper 1.4.0", "itertools 0.12.1", "md-5", "parking_lot", @@ -6462,7 +6462,7 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "opendatafabric" -version = "0.189.2" +version = "0.189.3" dependencies = [ "arrow", "base64 0.21.7", @@ -7320,7 +7320,7 @@ dependencies = [ [[package]] name = "random-names" -version = "0.189.2" +version = "0.189.3" dependencies = [ "rand", ] @@ -7489,7 +7489,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-rustls 0.27.2", "hyper-util", "ipnet", @@ -8054,9 +8054,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.118" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -8096,9 +8096,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.8.1" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +checksum = "079f3a42cd87588d924ed95b533f8d30a483388c4e400ab736a7058e34f16169" dependencies = [ "base64 0.22.1", "chrono", @@ -8114,9 +8114,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.8.1" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +checksum = "bc03aad67c1d26b7de277d51c86892e7d9a0110a2fe44bf6b26cc569fba302d6" dependencies = [ "darling", "proc-macro2", @@ -9320,7 +9320,7 @@ dependencies = [ [[package]] name = "tracing-perfetto" -version = "0.189.2" +version = "0.189.3" dependencies = [ "conv", "serde", diff --git a/Cargo.toml b/Cargo.toml index 74ff11e727..a678cbca0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,68 +66,68 @@ resolver = "2" [workspace.dependencies] # Apps -kamu-cli = { version = "0.189.2", path = "src/app/cli", default-features = false } +kamu-cli = { version = "0.189.3", path = "src/app/cli", default-features = false } # Utils -container-runtime = { version = "0.189.2", path = "src/utils/container-runtime", default-features = false } -database-common = { version = "0.189.2", path = "src/utils/database-common", default-features = false } -enum-variants = { version = "0.189.2", path = "src/utils/enum-variants", default-features = false } -event-bus = { version = "0.189.2", path = "src/utils/event-bus", default-features = false } -event-sourcing = { version = "0.189.2", path = "src/utils/event-sourcing", default-features = false } -event-sourcing-macros = { version = "0.189.2", path = "src/utils/event-sourcing-macros", default-features = false } -internal-error = { version = "0.189.2", path = "src/utils/internal-error", default-features = false } -kamu-data-utils = { version = "0.189.2", path = "src/utils/data-utils", default-features = false } -kamu-datafusion-cli = { version = "0.189.2", path = "src/utils/datafusion-cli", default-features = false } -multiformats = { version = "0.189.2", path = "src/utils/multiformats", default-features = false } -random-names = { version = "0.189.2", path = "src/utils/random-names", default-features = false } -tracing-perfetto = { version = "0.189.2", path = "src/utils/tracing-perfetto", default-features = false } +container-runtime = { version = "0.189.3", path = "src/utils/container-runtime", default-features = false } +database-common = { version = "0.189.3", path = "src/utils/database-common", default-features = false } +enum-variants = { version = "0.189.3", path = "src/utils/enum-variants", default-features = false } +event-bus = { version = "0.189.3", path = "src/utils/event-bus", default-features = false } +event-sourcing = { version = "0.189.3", path = "src/utils/event-sourcing", default-features = false } +event-sourcing-macros = { version = "0.189.3", path = "src/utils/event-sourcing-macros", default-features = false } +internal-error = { version = "0.189.3", path = "src/utils/internal-error", default-features = false } +kamu-data-utils = { version = "0.189.3", path = "src/utils/data-utils", default-features = false } +kamu-datafusion-cli = { version = "0.189.3", path = "src/utils/datafusion-cli", default-features = false } +multiformats = { version = "0.189.3", path = "src/utils/multiformats", default-features = false } +random-names = { version = "0.189.3", path = "src/utils/random-names", default-features = false } +tracing-perfetto = { version = "0.189.3", path = "src/utils/tracing-perfetto", default-features = false } # Domain -opendatafabric = { version = "0.189.2", path = "src/domain/opendatafabric", default-features = false } -kamu-core = { version = "0.189.2", path = "src/domain/core", default-features = false } -kamu-accounts = { version = "0.189.2", path = "src/domain/accounts/domain", default-features = false } -kamu-task-system = { version = "0.189.2", path = "src/domain/task-system/domain", default-features = false } -kamu-flow-system = { version = "0.189.2", path = "src/domain/flow-system/domain", default-features = false } +opendatafabric = { version = "0.189.3", path = "src/domain/opendatafabric", default-features = false } +kamu-core = { version = "0.189.3", path = "src/domain/core", default-features = false } +kamu-accounts = { version = "0.189.3", path = "src/domain/accounts/domain", default-features = false } +kamu-task-system = { version = "0.189.3", path = "src/domain/task-system/domain", default-features = false } +kamu-flow-system = { version = "0.189.3", path = "src/domain/flow-system/domain", default-features = false } # Domain service layer -kamu-accounts-services = { version = "0.189.2", path = "src/domain/accounts/services", default-features = false } -kamu-task-system-services = { version = "0.189.2", path = "src/domain/task-system/services", default-features = false } -kamu-flow-system-services = { version = "0.189.2", path = "src/domain/flow-system/services", default-features = false } +kamu-accounts-services = { version = "0.189.3", path = "src/domain/accounts/services", default-features = false } +kamu-task-system-services = { version = "0.189.3", path = "src/domain/task-system/services", default-features = false } +kamu-flow-system-services = { version = "0.189.3", path = "src/domain/flow-system/services", default-features = false } # Infra -kamu = { version = "0.189.2", path = "src/infra/core", default-features = false } -kamu-ingest-datafusion = { version = "0.189.2", path = "src/infra/ingest-datafusion", default-features = false } +kamu = { version = "0.189.3", path = "src/infra/core", default-features = false } +kamu-ingest-datafusion = { version = "0.189.3", path = "src/infra/ingest-datafusion", default-features = false } ## Flow System -kamu-flow-system-repo-tests = { version = "0.189.2", path = "src/infra/flow-system/repo-tests", default-features = false } -kamu-flow-system-inmem = { version = "0.189.2", path = "src/infra/flow-system/inmem", default-features = false } -kamu-flow-system-postgres = { version = "0.189.2", path = "src/infra/flow-system/postgres", default-features = false } -kamu-flow-system-sqlite = { version = "0.189.2", path = "src/infra/flow-system/sqlite", default-features = false } +kamu-flow-system-repo-tests = { version = "0.189.3", path = "src/infra/flow-system/repo-tests", default-features = false } +kamu-flow-system-inmem = { version = "0.189.3", path = "src/infra/flow-system/inmem", default-features = false } +kamu-flow-system-postgres = { version = "0.189.3", path = "src/infra/flow-system/postgres", default-features = false } +kamu-flow-system-sqlite = { version = "0.189.3", path = "src/infra/flow-system/sqlite", default-features = false } ## Accounts -kamu-accounts-inmem = { version = "0.189.2", path = "src/infra/accounts/inmem", default-features = false } -kamu-accounts-mysql = { version = "0.189.2", path = "src/infra/accounts/mysql", default-features = false } -kamu-accounts-postgres = { version = "0.189.2", path = "src/infra/accounts/postgres", default-features = false } -kamu-accounts-sqlite = { version = "0.189.2", path = "src/infra/accounts/sqlite", default-features = false } -kamu-accounts-repo-tests = { version = "0.189.2", path = "src/infra/accounts/repo-tests", default-features = false } +kamu-accounts-inmem = { version = "0.189.3", path = "src/infra/accounts/inmem", default-features = false } +kamu-accounts-mysql = { version = "0.189.3", path = "src/infra/accounts/mysql", default-features = false } +kamu-accounts-postgres = { version = "0.189.3", path = "src/infra/accounts/postgres", default-features = false } +kamu-accounts-sqlite = { version = "0.189.3", path = "src/infra/accounts/sqlite", default-features = false } +kamu-accounts-repo-tests = { version = "0.189.3", path = "src/infra/accounts/repo-tests", default-features = false } ## Task System -kamu-task-system-inmem = { version = "0.189.2", path = "src/infra/task-system/inmem", default-features = false } -kamu-task-system-postgres = { version = "0.189.2", path = "src/infra/task-system/postgres", default-features = false } -kamu-task-system-sqlite = { version = "0.189.2", path = "src/infra/task-system/sqlite", default-features = false } -kamu-task-system-repo-tests = { version = "0.189.2", path = "src/infra/task-system/repo-tests", default-features = false } +kamu-task-system-inmem = { version = "0.189.3", path = "src/infra/task-system/inmem", default-features = false } +kamu-task-system-postgres = { version = "0.189.3", path = "src/infra/task-system/postgres", default-features = false } +kamu-task-system-sqlite = { version = "0.189.3", path = "src/infra/task-system/sqlite", default-features = false } +kamu-task-system-repo-tests = { version = "0.189.3", path = "src/infra/task-system/repo-tests", default-features = false } # Adapters -kamu-adapter-auth-oso = { version = "0.189.2", path = "src/adapter/auth-oso", default-features = false } -kamu-adapter-flight-sql = { version = "0.189.2", path = "src/adapter/flight-sql", default-features = false } -kamu-adapter-graphql = { version = "0.189.2", path = "src/adapter/graphql", default-features = false } -kamu-adapter-http = { version = "0.189.2", path = "src/adapter/http", default-features = false } -kamu-adapter-odata = { version = "0.189.2", path = "src/adapter/odata", defualt-features = false } -kamu-adapter-oauth = { version = "0.189.2", path = "src/adapter/oauth", defualt-features = false } +kamu-adapter-auth-oso = { version = "0.189.3", path = "src/adapter/auth-oso", default-features = false } +kamu-adapter-flight-sql = { version = "0.189.3", path = "src/adapter/flight-sql", default-features = false } +kamu-adapter-graphql = { version = "0.189.3", path = "src/adapter/graphql", default-features = false } +kamu-adapter-http = { version = "0.189.3", path = "src/adapter/http", default-features = false } +kamu-adapter-odata = { version = "0.189.3", path = "src/adapter/odata", defualt-features = false } +kamu-adapter-oauth = { version = "0.189.3", path = "src/adapter/oauth", defualt-features = false } # E2E -kamu-cli-e2e-common = { version = "0.189.2", path = "src/e2e/app/cli/common", defualt-features = false } -kamu-cli-e2e-repo-tests = { version = "0.189.2", path = "src/e2e/app/cli/repo-tests", defualt-features = false } +kamu-cli-e2e-common = { version = "0.189.3", path = "src/e2e/app/cli/common", defualt-features = false } +kamu-cli-e2e-repo-tests = { version = "0.189.3", path = "src/e2e/app/cli/repo-tests", defualt-features = false } [workspace.package] -version = "0.189.2" +version = "0.189.3" edition = "2021" homepage = "https://github.com/kamu-data/kamu-cli" repository = "https://github.com/kamu-data/kamu-cli" diff --git a/LICENSE.txt b/LICENSE.txt index 4dbed5508a..d4bcf0d979 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -11,7 +11,7 @@ Business Source License 1.1 Licensor: Kamu Data, Inc. -Licensed Work: Kamu CLI Version 0.189.2 +Licensed Work: Kamu CLI Version 0.189.3 The Licensed Work is © 2023 Kamu Data, Inc. Additional Use Grant: You may use the Licensed Work for any purpose, diff --git a/images/sqlx-cli-with-migrations/Dockerfile b/images/sqlx-cli-with-migrations/Dockerfile index 720f8dd539..f0bf63fe73 100644 --- a/images/sqlx-cli-with-migrations/Dockerfile +++ b/images/sqlx-cli-with-migrations/Dockerfile @@ -5,4 +5,17 @@ LABEL org.opencontainers.image.source https://github.com/kamu-data/kamu-cli ################################################################################ +# Install dependencies +RUN apk --no-cache add \ + bash \ + curl \ + jq && \ + # Download and install the AWS CLI version 2 + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip && \ + ./aws/install && \ + rm -rf awscliv2.zip aws + +COPY scripts /scripts + COPY ./migrations/ /migrations/ diff --git a/images/sqlx-cli-with-migrations/scripts/fetch-db-secret.sh b/images/sqlx-cli-with-migrations/scripts/fetch-db-secret.sh new file mode 100644 index 0000000000..9aecbacc75 --- /dev/null +++ b/images/sqlx-cli-with-migrations/scripts/fetch-db-secret.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +if [ $# -ne 6 ]; then + echo "Usage: $0 " + exit 1 +fi + +SECRET_NAME="$1" +REGION="$2" +DB_PROVIDER="$3" +DB_HOST="$4" +DB_PORT="$5" +DB_NAME="$6" + +SECRET_STRING=$(aws secretsmanager get-secret-value --secret-id $SECRET_NAME --region $REGION --query SecretString --output text) +USERNAME=$(echo $SECRET_STRING | jq -r .username) +PASSWORD=$(echo $SECRET_STRING | jq -r .password) + +export DB_CONNECTION_STRING="${DB_PROVIDER}://${USERNAME}:${PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}" + +exec "$@" diff --git a/images/sqlx-cli-with-migrations/scripts/run-db-migrations.sh b/images/sqlx-cli-with-migrations/scripts/run-db-migrations.sh new file mode 100644 index 0000000000..8309faa222 --- /dev/null +++ b/images/sqlx-cli-with-migrations/scripts/run-db-migrations.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +if [ -z "$DB_CONNECTION_STRING" ]; then + echo "Error: DB_CONNECTION_STRING is not defined." + exit 1 +fi + +if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +SOURCE_DIR="$1" + +sqlx migrate run --source "$SOURCE_DIR" --database-url "$DB_CONNECTION_STRING"