mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
build: unify sandbox and production cargo features as release (#1356)
This commit is contained in:
4
.github/workflows/CI.yml
vendored
4
.github/workflows/CI.yml
vendored
@ -189,7 +189,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cargo hack router
|
- name: Cargo hack router
|
||||||
if: env.router_changes_exist == 'true'
|
if: env.router_changes_exist == 'true'
|
||||||
run: cargo hack check --each-feature --skip kms,basilisk,production,kv_store,accounts_cache,openapi --no-dev-deps -p router
|
run: cargo hack check --each-feature --skip kms,basilisk,kv_store,accounts_cache,openapi --no-dev-deps -p router
|
||||||
|
|
||||||
- name: Cargo hack router_derive
|
- name: Cargo hack router_derive
|
||||||
if: env.router_derive_changes_exist == 'true'
|
if: env.router_derive_changes_exist == 'true'
|
||||||
@ -361,7 +361,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cargo hack router
|
- name: Cargo hack router
|
||||||
if: env.router_changes_exist == 'true'
|
if: env.router_changes_exist == 'true'
|
||||||
run: cargo hack check --each-feature --skip kms,basilisk,production,kv_store,accounts_cache,openapi --no-dev-deps -p router
|
run: cargo hack check --each-feature --skip kms,basilisk,kv_store,accounts_cache,openapi --no-dev-deps -p router
|
||||||
|
|
||||||
- name: Cargo hack router_derive
|
- name: Cargo hack router_derive
|
||||||
if: env.router_derive_changes_exist == 'true'
|
if: env.router_derive_changes_exist == 'true'
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
FROM rust:slim as builder
|
FROM rust:slim as builder
|
||||||
|
|
||||||
ARG RUN_ENV=sandbox
|
|
||||||
ARG EXTRA_FEATURES=""
|
ARG EXTRA_FEATURES=""
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@ -33,7 +32,7 @@ ENV RUST_BACKTRACE="short"
|
|||||||
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
|
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo build --release --features ${RUN_ENV} ${EXTRA_FEATURES}
|
RUN cargo build --release --features release ${EXTRA_FEATURES}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,8 +16,7 @@ kms = ["external_services/kms","dep:aws-config"]
|
|||||||
email = ["external_services/email","dep:aws-config"]
|
email = ["external_services/email","dep:aws-config"]
|
||||||
basilisk = ["kms"]
|
basilisk = ["kms"]
|
||||||
stripe = ["dep:serde_qs"]
|
stripe = ["dep:serde_qs"]
|
||||||
sandbox = ["kms", "stripe", "basilisk", "s3", "email"]
|
release = ["kms", "stripe", "basilisk", "s3", "email"]
|
||||||
production = ["kms", "stripe", "basilisk", "s3", "email"]
|
|
||||||
olap = []
|
olap = []
|
||||||
oltp = []
|
oltp = []
|
||||||
kv_store = []
|
kv_store = []
|
||||||
|
|||||||
@ -241,11 +241,7 @@ pub async fn mk_add_card_request_hs(
|
|||||||
customer_id: &str,
|
customer_id: &str,
|
||||||
merchant_id: &str,
|
merchant_id: &str,
|
||||||
) -> CustomResult<services::Request, errors::VaultError> {
|
) -> CustomResult<services::Request, errors::VaultError> {
|
||||||
let merchant_customer_id = if cfg!(feature = "sandbox") {
|
let merchant_customer_id = customer_id.to_owned();
|
||||||
format!("{customer_id}::{merchant_id}")
|
|
||||||
} else {
|
|
||||||
customer_id.to_owned()
|
|
||||||
};
|
|
||||||
let card = Card {
|
let card = Card {
|
||||||
card_number: card.card_number.to_owned(),
|
card_number: card.card_number.to_owned(),
|
||||||
name_on_card: card.card_holder_name.to_owned(),
|
name_on_card: card.card_holder_name.to_owned(),
|
||||||
@ -359,7 +355,7 @@ pub fn mk_add_card_request(
|
|||||||
locker_id: &str,
|
locker_id: &str,
|
||||||
merchant_id: &str,
|
merchant_id: &str,
|
||||||
) -> CustomResult<services::Request, errors::VaultError> {
|
) -> CustomResult<services::Request, errors::VaultError> {
|
||||||
let customer_id = if cfg!(feature = "sandbox") {
|
let customer_id = if cfg!(feature = "release") {
|
||||||
format!("{customer_id}::{merchant_id}")
|
format!("{customer_id}::{merchant_id}")
|
||||||
} else {
|
} else {
|
||||||
customer_id.to_owned()
|
customer_id.to_owned()
|
||||||
@ -398,11 +394,7 @@ pub async fn mk_get_card_request_hs(
|
|||||||
merchant_id: &str,
|
merchant_id: &str,
|
||||||
card_reference: &str,
|
card_reference: &str,
|
||||||
) -> CustomResult<services::Request, errors::VaultError> {
|
) -> CustomResult<services::Request, errors::VaultError> {
|
||||||
let merchant_customer_id = if cfg!(feature = "sandbox") {
|
let merchant_customer_id = customer_id.to_owned();
|
||||||
format!("{customer_id}::{merchant_id}")
|
|
||||||
} else {
|
|
||||||
customer_id.to_owned()
|
|
||||||
};
|
|
||||||
let card_req_body = CardReqBody {
|
let card_req_body = CardReqBody {
|
||||||
merchant_id,
|
merchant_id,
|
||||||
merchant_customer_id,
|
merchant_customer_id,
|
||||||
@ -482,11 +474,7 @@ pub async fn mk_delete_card_request_hs(
|
|||||||
merchant_id: &str,
|
merchant_id: &str,
|
||||||
card_reference: &str,
|
card_reference: &str,
|
||||||
) -> CustomResult<services::Request, errors::VaultError> {
|
) -> CustomResult<services::Request, errors::VaultError> {
|
||||||
let merchant_customer_id = if cfg!(feature = "sandbox") {
|
let merchant_customer_id = customer_id.to_owned();
|
||||||
format!("{customer_id}::{merchant_id}")
|
|
||||||
} else {
|
|
||||||
customer_id.to_owned()
|
|
||||||
};
|
|
||||||
let card_req_body = CardReqBody {
|
let card_req_body = CardReqBody {
|
||||||
merchant_id,
|
merchant_id,
|
||||||
merchant_customer_id,
|
merchant_customer_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user