Skip to content

Commit

Permalink
feat(php): wait on PHPFPM_PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jul 12, 2024
1 parent 1c71028 commit 3865a1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion php/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn setup() -> Result<String, Error> {
dag().set_envs(vec![("PHPRC".into(), pwd.clone())])?;
}
if phpfpm_port.is_empty() {
dag().set_envs(vec![("PHPFPM_PORT".into(), "8080".into())])?;
dag().set_envs(vec![("PHPFPM_PORT".into(), "9000".into())])?;
}

if phpfpm_pid_file.is_empty() {
Expand Down
3 changes: 3 additions & 0 deletions php/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pub mod helpers;
pub fn start(_args: String) -> FnResult<String> {
helpers::setup()?;

let port = dag().get_env("PHPFPM_PORT")?;

let stdout = dag()
.flox()?
.with_workdir(".fluentci")?
Expand All @@ -20,6 +22,7 @@ pub fn start(_args: String) -> FnResult<String> {
.with_exec(vec!["overmind", "start", "-f", "Procfile", "--daemonize"])?
.with_exec(vec!["sleep", "2"])?
.with_exec(vec!["overmind", "status"])?
.wait_on(port.parse()?, None)?
.stdout()?;
Ok(stdout)
}
Expand Down

0 comments on commit 3865a1b

Please sign in to comment.