Skip to content

Commit

Permalink
[nginx] wait on $NGINX_WEB_PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jul 11, 2024
1 parent 5ea616e commit be7981d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nginx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod helpers;
#[plugin_fn]
pub fn start(_args: String) -> FnResult<String> {
helpers::setup()?;
let port = dag().get_env("NGINX_WEB_PORT")?;
let stdout = dag()
.flox()?
.with_workdir(".fluentci")?
Expand All @@ -17,7 +18,7 @@ pub fn start(_args: String) -> FnResult<String> {
"echo -e \"Nginx starting on port $NGINX_WEB_PORT\\n http://localhost:$NGINX_WEB_PORT\"",
])?
.with_exec(vec!["overmind", "start", "-f", "Procfile", "--daemonize"])?
.with_exec(vec!["sleep", "3"])?
.wait_on(port.parse()?, None)?
.with_exec(vec!["overmind", "status"])?
.with_exec(vec!["curl", "-s", "http://localhost:$NGINX_WEB_PORT"])?
.stdout()?;
Expand Down

0 comments on commit be7981d

Please sign in to comment.