Compare commits

..

No commits in common. "764fd6d451ab9dfafb3b0c2e1fb662e9677338fa" and "d8e8a497452e695fa5939c0d5d31b166b65b75f4" have entirely different histories.

2 changed files with 2 additions and 23 deletions

View File

@ -24,7 +24,6 @@ async fn main() {
// This config can be extended as needed for more complicated configurations // This config can be extended as needed for more complicated configurations
config: LAMPConfig { config: LAMPConfig {
project_root: "./php".into(), project_root: "./php".into(),
database_size: format!("2Gi").into(),
..Default::default() ..Default::default()
}, },
}; };

View File

@ -3,7 +3,6 @@ use dockerfile_builder::instruction::{CMD, COPY, ENV, EXPOSE, FROM, RUN, WORKDIR
use dockerfile_builder::{Dockerfile, instruction_builder::EnvBuilder}; use dockerfile_builder::{Dockerfile, instruction_builder::EnvBuilder};
use non_blank_string_rs::NonBlankString; use non_blank_string_rs::NonBlankString;
use serde_json::json; use serde_json::json;
use std::collections::HashMap;
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::str::FromStr; use std::str::FromStr;
@ -37,7 +36,6 @@ pub struct LAMPScore {
pub struct LAMPConfig { pub struct LAMPConfig {
pub project_root: PathBuf, pub project_root: PathBuf,
pub ssl_enabled: bool, pub ssl_enabled: bool,
pub database_size: Option<String>,
} }
impl Default for LAMPConfig { impl Default for LAMPConfig {
@ -45,7 +43,6 @@ impl Default for LAMPConfig {
LAMPConfig { LAMPConfig {
project_root: Path::new("./src").to_path_buf(), project_root: Path::new("./src").to_path_buf(),
ssl_enabled: true, ssl_enabled: true,
database_size: None,
} }
} }
} }
@ -116,10 +113,6 @@ impl<T: Topology + K8sclient + HelmCommand> Interpret<T> for LAMPInterpret {
} }
} }
}, },
{
"name": "MYSQL_HOST",
"value": secret_name
},
]), ]),
}; };
@ -159,13 +152,6 @@ impl LAMPInterpret {
inventory: &Inventory, inventory: &Inventory,
topology: &T, topology: &T,
) -> Result<Outcome, InterpretError> { ) -> Result<Outcome, InterpretError> {
let mut values_overrides = HashMap::new();
if let Some(database_size) = self.score.config.database_size.clone() {
values_overrides.insert(
NonBlankString::from_str("primary.persistence.size").unwrap(),
database_size,
);
}
let score = HelmChartScore { let score = HelmChartScore {
namespace: self.get_namespace(), namespace: self.get_namespace(),
release_name: NonBlankString::from_str(&format!("{}-database", self.score.name)) release_name: NonBlankString::from_str(&format!("{}-database", self.score.name))
@ -175,7 +161,7 @@ impl LAMPInterpret {
) )
.unwrap(), .unwrap(),
chart_version: None, chart_version: None,
values_overrides: Some(values_overrides), values_overrides: None,
create_namespace: true, create_namespace: true,
install_only: true, install_only: true,
values_yaml: None, values_yaml: None,
@ -183,6 +169,7 @@ impl LAMPInterpret {
score.create_interpret().execute(inventory, topology).await score.create_interpret().execute(inventory, topology).await
} }
fn build_dockerfile(&self, score: &LAMPScore) -> Result<PathBuf, Box<dyn std::error::Error>> { fn build_dockerfile(&self, score: &LAMPScore) -> Result<PathBuf, Box<dyn std::error::Error>> {
let mut dockerfile = Dockerfile::new(); let mut dockerfile = Dockerfile::new();
@ -270,13 +257,6 @@ opcache.fast_shutdown=1
sed -i 's/ServerSignature On/ServerSignature Off/' /etc/apache2/conf-enabled/security.conf" sed -i 's/ServerSignature On/ServerSignature Off/' /etc/apache2/conf-enabled/security.conf"
)); ));
// Set env vars
dockerfile.push(RUN::from(
"echo 'PassEnv MYSQL_PASSWORD' >> /etc/apache2/sites-available/000-default.conf \
&& echo 'PassEnv MYSQL_USER' >> /etc/apache2/sites-available/000-default.conf \
&& echo 'PassEnv MYSQL_HOST' >> /etc/apache2/sites-available/000-default.conf",
));
// Create a dedicated user for running Apache // Create a dedicated user for running Apache
dockerfile.push(RUN::from( dockerfile.push(RUN::from(
"groupadd -g 1000 appuser && \ "groupadd -g 1000 appuser && \