mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
Add new field ports for applications (#511)
This commit is contained in:
committed by
GitHub
parent
e9abe79d96
commit
2bb83cb222
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -3924,6 +3924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
dependencies = [
|
||||
"getrandom 0.2.3",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -24,7 +24,7 @@ reqwest = { version = "0.11.3", features = ["blocking", "json"] }
|
||||
futures = "0.3.15"
|
||||
timeout-readwrite = "0.3.1"
|
||||
lazy_static = "1.4.0"
|
||||
uuid = { version = "0.8", features = ["v4"] }
|
||||
uuid = { version = "0.8", features = ["v4", "serde"] }
|
||||
url = "2.2.2"
|
||||
function_name = "0.2.0"
|
||||
|
||||
|
||||
@@ -66,9 +66,11 @@ spec:
|
||||
{%- endfor %}
|
||||
{%- if private_port %}
|
||||
ports:
|
||||
- containerPort: {{ private_port }}
|
||||
name: "p{{ private_port }}"
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ private_port }}
|
||||
|
||||
@@ -12,10 +12,12 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
{%- for port in ports %}
|
||||
- protocol: TCP
|
||||
name: "p{{ private_port }}"
|
||||
port: {{ private_port }}
|
||||
targetPort: {{ private_port }}
|
||||
name: "p{{ port.port }}"
|
||||
port: {{ port.port }}
|
||||
targetPort: {{ port.port }}
|
||||
{%- endfor %}
|
||||
selector:
|
||||
ownerId: {{ owner_id }}
|
||||
appId: {{ id }}
|
||||
|
||||
@@ -61,9 +61,11 @@ spec:
|
||||
{%- endfor %}
|
||||
{%- if private_port %}
|
||||
ports:
|
||||
- containerPort: {{ private_port }}
|
||||
name: "p{{ private_port }}"
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ private_port }}
|
||||
|
||||
@@ -66,9 +66,11 @@ spec:
|
||||
{%- endfor %}
|
||||
{%- if private_port %}
|
||||
ports:
|
||||
- containerPort: {{ private_port }}
|
||||
name: "p{{ private_port }}"
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ private_port }}
|
||||
|
||||
@@ -12,10 +12,12 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
{%- for port in ports %}
|
||||
- protocol: TCP
|
||||
name: "p{{ private_port }}"
|
||||
port: {{ private_port }}
|
||||
targetPort: {{ private_port }}
|
||||
name: "p{{ port.port }}"
|
||||
port: {{ port.port }}
|
||||
targetPort: {{ port.port }}
|
||||
{%- endfor %}
|
||||
selector:
|
||||
ownerId: {{ owner_id }}
|
||||
appId: {{ id }}
|
||||
|
||||
@@ -61,9 +61,11 @@ spec:
|
||||
{%- endfor %}
|
||||
{%- if private_port %}
|
||||
ports:
|
||||
- containerPort: {{ private_port }}
|
||||
name: "p{{ private_port }}"
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ private_port }}
|
||||
|
||||
@@ -65,9 +65,11 @@ spec:
|
||||
{%- endfor %}
|
||||
{%- if private_port %}
|
||||
ports:
|
||||
- containerPort: {{ private_port }}
|
||||
name: "p{{ private_port }}"
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ private_port }}
|
||||
|
||||
@@ -12,10 +12,11 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: "p{{ private_port }}"
|
||||
port: {{ private_port }}
|
||||
targetPort: {{ private_port }}
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
selector:
|
||||
ownerId: {{ owner_id }}
|
||||
appId: {{ id }}
|
||||
|
||||
@@ -61,9 +61,11 @@ spec:
|
||||
{%- endfor %}
|
||||
{%- if private_port %}
|
||||
ports:
|
||||
- containerPort: {{ private_port }}
|
||||
name: "p{{ private_port }}"
|
||||
{%- for port in ports %}
|
||||
- containerPort: {{ port.port }}
|
||||
name: "p{{ port.port }}"
|
||||
protocol: TCP
|
||||
{%- endfor %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ private_port }}
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::cmd::helm::Timeout;
|
||||
use crate::cmd::kubectl::ScalingKind::{Deployment, Statefulset};
|
||||
use crate::error::EngineErrorCause::Internal;
|
||||
use crate::error::{EngineError, EngineErrorScope};
|
||||
use crate::models::{Context, Listen, Listener, Listeners, ListenersHelper};
|
||||
use crate::models::{Context, Listen, Listener, Listeners, ListenersHelper, Port};
|
||||
use ::function_name::named;
|
||||
|
||||
pub struct Application {
|
||||
@@ -23,7 +23,7 @@ pub struct Application {
|
||||
id: String,
|
||||
action: Action,
|
||||
name: String,
|
||||
private_port: Option<u16>,
|
||||
ports: Vec<Port>,
|
||||
total_cpus: String,
|
||||
cpu_burst: String,
|
||||
total_ram_in_mib: u32,
|
||||
@@ -41,7 +41,7 @@ impl Application {
|
||||
id: &str,
|
||||
action: Action,
|
||||
name: &str,
|
||||
private_port: Option<u16>,
|
||||
ports: Vec<Port>,
|
||||
total_cpus: String,
|
||||
cpu_burst: String,
|
||||
total_ram_in_mib: u32,
|
||||
@@ -57,7 +57,7 @@ impl Application {
|
||||
id: id.to_string(),
|
||||
action,
|
||||
name: name.to_string(),
|
||||
private_port,
|
||||
ports,
|
||||
total_cpus,
|
||||
cpu_burst,
|
||||
total_ram_in_mib,
|
||||
@@ -143,7 +143,10 @@ impl Service for Application {
|
||||
}
|
||||
|
||||
fn private_port(&self) -> Option<u16> {
|
||||
self.private_port
|
||||
self.ports
|
||||
.iter()
|
||||
.find(|port| port.publicly_accessible)
|
||||
.map(|port| port.port)
|
||||
}
|
||||
|
||||
fn start_timeout(&self) -> Timeout<u32> {
|
||||
@@ -167,7 +170,7 @@ impl Service for Application {
|
||||
}
|
||||
|
||||
fn publicly_accessible(&self) -> bool {
|
||||
self.private_port.is_some()
|
||||
self.private_port().is_some()
|
||||
}
|
||||
|
||||
fn tera_context(&self, target: &DeploymentTarget) -> Result<TeraContext, EngineError> {
|
||||
@@ -198,6 +201,7 @@ impl Service for Application {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
context.insert("environment_variables", &environment_variables);
|
||||
context.insert("ports", &self.ports);
|
||||
|
||||
match self.image.registry_name.as_ref() {
|
||||
Some(registry_name) => {
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::cmd::helm::Timeout;
|
||||
use crate::cmd::kubectl::ScalingKind::{Deployment, Statefulset};
|
||||
use crate::error::EngineErrorCause::Internal;
|
||||
use crate::error::{EngineError, EngineErrorScope};
|
||||
use crate::models::{Context, Listen, Listener, Listeners, ListenersHelper};
|
||||
use crate::models::{Context, Listen, Listener, Listeners, ListenersHelper, Port};
|
||||
use ::function_name::named;
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
@@ -25,7 +25,7 @@ pub struct Application {
|
||||
id: String,
|
||||
action: Action,
|
||||
name: String,
|
||||
private_port: Option<u16>,
|
||||
ports: Vec<Port>,
|
||||
total_cpus: String,
|
||||
cpu_burst: String,
|
||||
total_ram_in_mib: u32,
|
||||
@@ -43,7 +43,7 @@ impl Application {
|
||||
id: &str,
|
||||
action: Action,
|
||||
name: &str,
|
||||
private_port: Option<u16>,
|
||||
ports: Vec<Port>,
|
||||
total_cpus: String,
|
||||
cpu_burst: String,
|
||||
total_ram_in_mib: u32,
|
||||
@@ -59,7 +59,7 @@ impl Application {
|
||||
id: id.to_string(),
|
||||
action,
|
||||
name: name.to_string(),
|
||||
private_port,
|
||||
ports,
|
||||
total_cpus,
|
||||
cpu_burst,
|
||||
total_ram_in_mib,
|
||||
@@ -145,7 +145,10 @@ impl Service for Application {
|
||||
}
|
||||
|
||||
fn private_port(&self) -> Option<u16> {
|
||||
self.private_port
|
||||
self.ports
|
||||
.iter()
|
||||
.find(|port| port.publicly_accessible)
|
||||
.map(|port| port.port)
|
||||
}
|
||||
|
||||
fn start_timeout(&self) -> Timeout<u32> {
|
||||
@@ -169,7 +172,7 @@ impl Service for Application {
|
||||
}
|
||||
|
||||
fn publicly_accessible(&self) -> bool {
|
||||
self.private_port.is_some()
|
||||
self.private_port().is_some()
|
||||
}
|
||||
|
||||
fn tera_context(&self, target: &DeploymentTarget) -> Result<TeraContext, EngineError> {
|
||||
@@ -221,6 +224,7 @@ impl Service for Application {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
context.insert("environment_variables", &environment_variables);
|
||||
context.insert("ports", &self.ports);
|
||||
|
||||
if self.image.registry_name.is_some() {
|
||||
context.insert("is_registry_secret", &true);
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::cmd::helm::Timeout;
|
||||
use crate::cmd::kubectl::ScalingKind::{Deployment, Statefulset};
|
||||
use crate::error::EngineErrorCause::Internal;
|
||||
use crate::error::{EngineError, EngineErrorScope};
|
||||
use crate::models::{Context, Listen, Listener, Listeners, ListenersHelper};
|
||||
use crate::models::{Context, Listen, Listener, Listeners, ListenersHelper, Port};
|
||||
use ::function_name::named;
|
||||
|
||||
pub struct Application {
|
||||
@@ -26,7 +26,7 @@ pub struct Application {
|
||||
id: String,
|
||||
action: Action,
|
||||
name: String,
|
||||
private_port: Option<u16>,
|
||||
ports: Vec<Port>,
|
||||
total_cpus: String,
|
||||
cpu_burst: String,
|
||||
total_ram_in_mib: u32,
|
||||
@@ -44,7 +44,7 @@ impl Application {
|
||||
id: &str,
|
||||
action: Action,
|
||||
name: &str,
|
||||
private_port: Option<u16>,
|
||||
ports: Vec<Port>,
|
||||
total_cpus: String,
|
||||
cpu_burst: String,
|
||||
total_ram_in_mib: u32,
|
||||
@@ -60,7 +60,7 @@ impl Application {
|
||||
id: id.to_string(),
|
||||
action,
|
||||
name: name.to_string(),
|
||||
private_port,
|
||||
ports,
|
||||
total_cpus,
|
||||
cpu_burst,
|
||||
total_ram_in_mib,
|
||||
@@ -146,7 +146,10 @@ impl Service for Application {
|
||||
}
|
||||
|
||||
fn private_port(&self) -> Option<u16> {
|
||||
self.private_port
|
||||
self.ports
|
||||
.iter()
|
||||
.find(|port| port.publicly_accessible)
|
||||
.map(|port| port.port)
|
||||
}
|
||||
|
||||
fn start_timeout(&self) -> Timeout<u32> {
|
||||
@@ -170,7 +173,7 @@ impl Service for Application {
|
||||
}
|
||||
|
||||
fn publicly_accessible(&self) -> bool {
|
||||
self.private_port.is_some()
|
||||
self.private_port().is_some()
|
||||
}
|
||||
|
||||
fn tera_context(&self, target: &DeploymentTarget) -> Result<TeraContext, EngineError> {
|
||||
@@ -206,6 +209,7 @@ impl Service for Application {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
context.insert("environment_variables", &environment_variables);
|
||||
context.insert("ports", &self.ports);
|
||||
|
||||
match self.image.registry_name.as_ref() {
|
||||
Some(_) => {
|
||||
|
||||
@@ -160,6 +160,24 @@ fn default_root_path_value() -> String {
|
||||
"/".to_string()
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Eq, PartialEq, Hash)]
|
||||
pub enum Protocol {
|
||||
HTTP,
|
||||
TCP,
|
||||
UDP,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Eq, PartialEq, Hash)]
|
||||
pub struct Port {
|
||||
pub id: String,
|
||||
pub long_id: uuid::Uuid,
|
||||
pub port: u16,
|
||||
pub public_port: Option<u16>,
|
||||
pub name: Option<String>,
|
||||
pub publicly_accessible: bool,
|
||||
pub protocol: Protocol,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Eq, PartialEq, Hash)]
|
||||
pub struct Application {
|
||||
pub id: String,
|
||||
@@ -173,7 +191,7 @@ pub struct Application {
|
||||
pub buildpack_language: Option<String>,
|
||||
#[serde(default = "default_root_path_value")]
|
||||
pub root_path: String,
|
||||
pub private_port: Option<u16>,
|
||||
pub ports: Vec<Port>,
|
||||
pub total_cpus: String,
|
||||
pub cpu_burst: String,
|
||||
pub total_ram_in_mib: u32,
|
||||
@@ -201,7 +219,7 @@ impl Application {
|
||||
self.id.as_str(),
|
||||
self.action.to_service_action(),
|
||||
self.name.as_str(),
|
||||
self.private_port,
|
||||
self.ports.clone(),
|
||||
self.total_cpus.clone(),
|
||||
self.cpu_burst.clone(),
|
||||
self.total_ram_in_mib,
|
||||
@@ -218,7 +236,7 @@ impl Application {
|
||||
self.id.as_str(),
|
||||
self.action.to_service_action(),
|
||||
self.name.as_str(),
|
||||
self.private_port,
|
||||
self.ports.clone(),
|
||||
self.total_cpus.clone(),
|
||||
self.cpu_burst.clone(),
|
||||
self.total_ram_in_mib,
|
||||
@@ -236,7 +254,7 @@ impl Application {
|
||||
self.id.as_str(),
|
||||
self.action.to_service_action(),
|
||||
self.name.as_str(),
|
||||
self.private_port,
|
||||
self.ports.clone(),
|
||||
self.total_cpus.clone(),
|
||||
self.cpu_burst.clone(),
|
||||
self.total_ram_in_mib,
|
||||
@@ -266,7 +284,7 @@ impl Application {
|
||||
self.id.as_str(),
|
||||
self.action.to_service_action(),
|
||||
self.name.as_str(),
|
||||
self.private_port,
|
||||
self.ports.clone(),
|
||||
self.total_cpus.clone(),
|
||||
self.cpu_burst.clone(),
|
||||
self.total_ram_in_mib,
|
||||
@@ -283,7 +301,7 @@ impl Application {
|
||||
self.id.as_str(),
|
||||
self.action.to_service_action(),
|
||||
self.name.as_str(),
|
||||
self.private_port,
|
||||
self.ports.clone(),
|
||||
self.total_cpus.clone(),
|
||||
self.cpu_burst.clone(),
|
||||
self.total_ram_in_mib,
|
||||
@@ -301,7 +319,7 @@ impl Application {
|
||||
self.id.as_str(),
|
||||
self.action.to_service_action(),
|
||||
self.name.as_str(),
|
||||
self.private_port,
|
||||
self.ports.clone(),
|
||||
self.total_cpus.clone(),
|
||||
self.cpu_burst.clone(),
|
||||
self.total_ram_in_mib,
|
||||
|
||||
1
test_utilities/Cargo.lock
generated
1
test_utilities/Cargo.lock
generated
@@ -3955,6 +3955,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
dependencies = [
|
||||
"getrandom 0.2.2",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -7,7 +7,7 @@ use qovery_engine::cloud_provider::utilities::sanitize_name;
|
||||
use qovery_engine::dns_provider::DnsProvider;
|
||||
use qovery_engine::models::{
|
||||
Action, Application, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction,
|
||||
GitCredentials, Route, Router, Storage, StorageType,
|
||||
GitCredentials, Port, Protocol, Route, Router, Storage, StorageType,
|
||||
};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
|
||||
@@ -256,7 +256,15 @@ pub fn environment_3_apps_3_routers_3_databases(
|
||||
"PG_PASSWORD".to_string() => base64::encode(database_password.clone()),
|
||||
},
|
||||
branch: "master".to_string(),
|
||||
private_port: Some(1234),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -293,7 +301,15 @@ pub fn environment_3_apps_3_routers_3_databases(
|
||||
"PG_PASSWORD".to_string() => base64::encode(database_password.clone()),
|
||||
},
|
||||
branch: "master".to_string(),
|
||||
private_port: Some(1234),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -332,7 +348,15 @@ pub fn environment_3_apps_3_routers_3_databases(
|
||||
"QOVERY_DATABASE_TESTING_DATABASE_PASSWORD".to_string() => base64::encode(database_password_mongo.clone()),
|
||||
},
|
||||
branch: "master".to_string(),
|
||||
private_port: Some(1234),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -478,7 +502,15 @@ pub fn working_minimal_environment(context: &Context, organization_id: &str, tes
|
||||
storage: vec![],
|
||||
environment_vars: BTreeMap::default(),
|
||||
branch: "basic-app-deploy".to_string(),
|
||||
private_port: Some(80),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 80,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -581,7 +613,15 @@ pub fn environnement_2_app_2_routers_1_psql(
|
||||
"PG_PASSWORD".to_string() => base64::encode(database_password.clone()),
|
||||
},
|
||||
branch: "master".to_string(),
|
||||
private_port: Some(1234),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -618,7 +658,15 @@ pub fn environnement_2_app_2_routers_1_psql(
|
||||
"PG_PASSWORD".to_string() => base64::encode(database_password.clone()),
|
||||
},
|
||||
branch: "master".to_string(),
|
||||
private_port: Some(1234),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -704,7 +752,15 @@ pub fn echo_app_environment(context: &Context, organization_id: &str, test_domai
|
||||
"ECHO_TEXT".to_string() => base64::encode("42"),
|
||||
},
|
||||
branch: "echo-app".to_string(),
|
||||
private_port: Some(5678),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 5678,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -755,7 +811,15 @@ pub fn environment_only_http_server(context: &Context, organization_id: &str) ->
|
||||
storage: vec![],
|
||||
environment_vars: BTreeMap::default(),
|
||||
branch: "mini-http".to_string(),
|
||||
private_port: Some(3000),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 3000,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -795,7 +859,15 @@ pub fn environment_only_http_server_router(context: &Context, organization_id: &
|
||||
storage: vec![],
|
||||
environment_vars: BTreeMap::default(),
|
||||
branch: "mini-http".to_string(),
|
||||
private_port: Some(3000),
|
||||
ports: vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 3000,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}],
|
||||
total_cpus: "100m".to_string(),
|
||||
total_ram_in_mib: 256,
|
||||
total_instances: 2,
|
||||
@@ -897,7 +969,15 @@ pub fn test_db(
|
||||
.map(|mut app| {
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = db_infos.app_commit.clone();
|
||||
app.private_port = Some(1234);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(1234),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.dockerfile_path = Some(format!("Dockerfile-{}", version));
|
||||
app.environment_vars = db_infos.app_env_vars.clone();
|
||||
app
|
||||
|
||||
@@ -3,7 +3,7 @@ extern crate test_utilities;
|
||||
use ::function_name::named;
|
||||
use qovery_engine::cloud_provider::Kind;
|
||||
use qovery_engine::models::{
|
||||
Action, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction,
|
||||
Action, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction, Port, Protocol,
|
||||
};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
use tracing::{span, Level};
|
||||
@@ -186,7 +186,15 @@ fn postgresql_failover_dev_environment_with_all_options() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = Some(4789);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 4789,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
@@ -398,7 +406,15 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
.map(|mut app| {
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "5990752647af11ef21c3d46a51abbde3da1ab351".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.environment_vars = btreemap! {
|
||||
"PG_DBNAME".to_string() => base64::encode(database_db_name.clone()),
|
||||
"PG_HOST".to_string() => base64::encode(database_host.clone()),
|
||||
|
||||
@@ -6,7 +6,7 @@ use self::test_utilities::utilities::{
|
||||
};
|
||||
use ::function_name::named;
|
||||
use qovery_engine::cloud_provider::Kind;
|
||||
use qovery_engine::models::{Action, Clone2, EnvironmentAction, Storage, StorageType};
|
||||
use qovery_engine::models::{Action, Clone2, EnvironmentAction, Port, Protocol, Storage, StorageType};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
use std::collections::BTreeMap;
|
||||
use test_utilities::utilities::{context, init};
|
||||
@@ -249,7 +249,15 @@ fn build_with_buildpacks_and_deploy_a_working_environment() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = Some(3000);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 3000,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.commit_id = "f59237d603829636138e2f22a0549e33b5dd6e1f".to_string();
|
||||
app.branch = "simple-node-app".to_string();
|
||||
app.dockerfile_path = None;
|
||||
@@ -309,7 +317,15 @@ fn build_worker_with_buildpacks_and_deploy_a_working_environment() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = None;
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 3000,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.commit_id = "4f35f4ab3e98426c5a3eaa91e788ff8ab466f19a".to_string();
|
||||
app.branch = "buildpack-process".to_string();
|
||||
app.dockerfile_path = None;
|
||||
|
||||
@@ -3,7 +3,7 @@ use tracing::{span, warn, Level};
|
||||
|
||||
use qovery_engine::cloud_provider::{Kind as ProviderKind, Kind};
|
||||
use qovery_engine::models::{
|
||||
Action, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction,
|
||||
Action, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction, Port, Protocol,
|
||||
};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
use test_utilities::utilities::{
|
||||
@@ -195,7 +195,15 @@ fn postgresql_failover_dev_environment_with_all_options() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = Some(4789);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 4789,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
@@ -428,7 +436,15 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
.map(|mut app| {
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "5990752647af11ef21c3d46a51abbde3da1ab351".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.environment_vars = btreemap! {
|
||||
"PG_DBNAME".to_string() => base64::encode(database_db_name.clone()),
|
||||
"PG_HOST".to_string() => base64::encode(database_host.clone()),
|
||||
|
||||
@@ -6,7 +6,7 @@ use self::test_utilities::utilities::{
|
||||
};
|
||||
use ::function_name::named;
|
||||
use qovery_engine::cloud_provider::Kind;
|
||||
use qovery_engine::models::{Action, Clone2, EnvironmentAction, Storage, StorageType};
|
||||
use qovery_engine::models::{Action, Clone2, EnvironmentAction, Port, Protocol, Storage, StorageType};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
use std::collections::BTreeMap;
|
||||
use test_utilities::common::Infrastructure;
|
||||
@@ -261,7 +261,15 @@ fn digitalocean_doks_build_with_buildpacks_and_deploy_a_working_environment() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = Some(3000);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 3000,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.commit_id = "f59237d603829636138e2f22a0549e33b5dd6e1f".to_string();
|
||||
app.branch = "simple-node-app".to_string();
|
||||
app.dockerfile_path = None;
|
||||
|
||||
@@ -3,7 +3,7 @@ use tracing::{span, warn, Level};
|
||||
|
||||
use qovery_engine::cloud_provider::{Kind as ProviderKind, Kind};
|
||||
use qovery_engine::models::{
|
||||
Action, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction,
|
||||
Action, Clone2, Context, Database, DatabaseKind, DatabaseMode, Environment, EnvironmentAction, Port, Protocol,
|
||||
};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
use test_utilities::utilities::{
|
||||
@@ -200,7 +200,15 @@ fn postgresql_failover_dev_environment_with_all_options() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = Some(4789);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 4789,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
@@ -433,7 +441,15 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
.map(|mut app| {
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "5990752647af11ef21c3d46a51abbde3da1ab351".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 1234,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.environment_vars = btreemap! {
|
||||
"PG_DBNAME".to_string() => base64::encode(database_db_name.clone()),
|
||||
"PG_HOST".to_string() => base64::encode(database_host.clone()),
|
||||
|
||||
@@ -6,7 +6,7 @@ use self::test_utilities::utilities::{
|
||||
};
|
||||
use ::function_name::named;
|
||||
use qovery_engine::cloud_provider::Kind;
|
||||
use qovery_engine::models::{Action, Clone2, EnvironmentAction, Storage, StorageType};
|
||||
use qovery_engine::models::{Action, Clone2, EnvironmentAction, Port, Protocol, Storage, StorageType};
|
||||
use qovery_engine::transaction::TransactionResult;
|
||||
use std::collections::BTreeMap;
|
||||
use test_utilities::common::Infrastructure;
|
||||
@@ -267,7 +267,15 @@ fn scaleway_kapsule_build_with_buildpacks_and_deploy_a_working_environment() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.private_port = Some(3000);
|
||||
app.ports = vec![Port {
|
||||
id: "zdf7d6aad".to_string(),
|
||||
long_id: Default::default(),
|
||||
port: 3000,
|
||||
public_port: Some(443),
|
||||
name: None,
|
||||
publicly_accessible: true,
|
||||
protocol: Protocol::HTTP,
|
||||
}];
|
||||
app.commit_id = "f59237d603829636138e2f22a0549e33b5dd6e1f".to_string();
|
||||
app.branch = "simple-node-app".to_string();
|
||||
app.dockerfile_path = None;
|
||||
|
||||
Reference in New Issue
Block a user