Skip to content

Commit

Permalink
fix(nginx): fix nginx.conf generation
Browse files Browse the repository at this point in the history
fix(nginx): fix nginx.conf generation
  • Loading branch information
tsirysndr committed Jul 11, 2024
1 parent 7287be6 commit 02d15c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nginx/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pub fn setup() -> Result<String, Error> {
dag()
.pipeline("setup")?
.with_exec(vec!["mkdir", "-p", ".fluentci"])?
.with_exec(vec!["mkdir", "-p", ".fluentci/logs", ".fluentci/temp"])?
.with_exec(vec![
"grep -q logs .fluentci/.gitignore || echo -e 'logs\ntemp' >> .fluentci/.gitignore",
])?
.stdout()?;

let nginx_port = dag().get_env("NGINX_WEB_PORT")?;
Expand All @@ -43,7 +47,8 @@ pub fn setup() -> Result<String, Error> {
.with_exec(vec!["[ -f ../nginx.template ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/nginx/nginx.template -O ../nginx.template"])?
.with_exec(vec!["[ -f fastcgi.conf ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/nginx/fastcgi.conf"])?
.with_exec(vec!["[ -f ../index.html ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/nginx/web/index.html -O ../index.html"])?
.with_exec(vec![r#"if [ -f ../nginx.template ]; then envsubst $(awk 'BEGIN {for (k in ENVIRON) {printf "$"k","}}') < ../nginx.template > nginx.conf; fi"#])?
.with_exec(vec!["[ -f ../nginx.template ] && envsubst < ../nginx.template > nginx.conf"])?
.with_exec(vec!["cat nginx.conf"])?
.with_exec(vec![
"grep -q nginx Procfile || echo 'nginx: nginx -p $PWD -c $PWD/nginx.conf -e error.log -g \"pid nginx.pid;daemon off;\"' >> Procfile",
])?
Expand Down

0 comments on commit 02d15c3

Please sign in to comment.