From 22ed2ef4c29c890d75adfff3972168b90b872edd Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Tue, 16 Jul 2024 15:22:17 +0000 Subject: [PATCH] fix: always activate flox environment --- apache/src/helpers.rs | 4 ++-- caddy/src/helpers.rs | 4 ++-- consul/src/helpers.rs | 4 ++-- nginx/src/helpers.rs | 8 ++++---- php/src/helpers.rs | 4 ++-- vault/src/helpers.rs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apache/src/helpers.rs b/apache/src/helpers.rs index 094690e..9058f5e 100644 --- a/apache/src/helpers.rs +++ b/apache/src/helpers.rs @@ -54,8 +54,8 @@ pub fn setup() -> Result { .with_exec(vec!["flox", "install", "apacheHttpd", "overmind", "tmux", "wget", "curl"])? .with_exec(vec!["mkdir", "-p", "log"])? .with_exec(vec![r#"[ -f log/.gitignore ] || echo -e 'error.log\naccess.log' > log/.gitignore"#])? - .with_exec(vec!["[ -f httpd.conf ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/apache/httpd.conf"])? - .with_exec(vec!["[ -f ../index.html ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/apache/web/index.html -O ../index.html"])? + .with_exec(vec!["[ -f httpd.conf ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/apache/httpd.conf"])? + .with_exec(vec!["[ -f ../index.html ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/apache/web/index.html -O ../index.html"])? .with_exec(vec![ "grep -q web Procfile || echo -e 'web: apachectl start -f $PWD/httpd.conf -D FOREGROUND\\n' >> Procfile", ])? diff --git a/caddy/src/helpers.rs b/caddy/src/helpers.rs index 398cc3e..4fba175 100644 --- a/caddy/src/helpers.rs +++ b/caddy/src/helpers.rs @@ -51,8 +51,8 @@ pub fn setup() -> Result { .flox()? .with_workdir(".fluentci")? .with_exec(vec!["flox", "install", "caddy", "overmind", "tmux", "wget", "curl"])? - .with_exec(vec!["[ -f ../Caddyfile ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/caddy/Caddyfile -O ../Caddyfile"])? - .with_exec(vec!["[ -f ../index.html ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/caddy/web/index.html -O ../index.html"])? + .with_exec(vec!["[ -f ../Caddyfile ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/caddy/Caddyfile -O ../Caddyfile"])? + .with_exec(vec!["[ -f ../index.html ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/caddy/web/index.html -O ../index.html"])? .with_exec(vec![ &format!("grep -q caddy Procfile || echo -e 'caddy: cd .. && caddy run {}\\n' >> Procfile", opts), ])? diff --git a/consul/src/helpers.rs b/consul/src/helpers.rs index 832f60c..42794b4 100644 --- a/consul/src/helpers.rs +++ b/consul/src/helpers.rs @@ -50,8 +50,8 @@ pub fn setup() -> Result { .with_exec(vec![ "flox", "install", "consul", "overmind", "tmux", "wget", "gettext" ])? - .with_exec(vec!["[ -f consul-config.json.template ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/consul/consul-config.json.template"])? - .with_exec(vec!["[ -f $CONSUL_CONFIG ] || envsubst < consul-config.json.template > $CONSUL_CONFIG "])? + .with_exec(vec!["[ -f consul-config.json.template ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/consul/consul-config.json.template"])? + .with_exec(vec!["[ -f $CONSUL_CONFIG ] || flox activate -- envsubst < consul-config.json.template > $CONSUL_CONFIG "])? .with_exec(vec![ "grep -q consul: Procfile || echo -e 'consul: consul agent -config-file=$CONSUL_CONFIG \\n' >> Procfile", ])? diff --git a/nginx/src/helpers.rs b/nginx/src/helpers.rs index a8c2665..2c3f8cd 100644 --- a/nginx/src/helpers.rs +++ b/nginx/src/helpers.rs @@ -44,10 +44,10 @@ pub fn setup() -> Result { .flox()? .with_workdir(".fluentci")? .with_exec(vec!["flox", "install", "nginx", "overmind", "tmux", "wget", "curl", "gettext"])? - .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!["[ -f ../nginx.template ] && envsubst < ../nginx.template > nginx.conf"])? + .with_exec(vec!["[ -f ../nginx.template ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/nginx/nginx.template -O ../nginx.template"])? + .with_exec(vec!["[ -f fastcgi.conf ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/nginx/fastcgi.conf"])? + .with_exec(vec!["[ -f ../index.html ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/nginx/web/index.html -O ../index.html"])? + .with_exec(vec!["[ -f ../nginx.template ] && flox activate -- envsubst < ../nginx.template > nginx.conf"])? .with_exec(vec!["cat nginx.conf"])? .with_exec(vec![ "grep -q nginx Procfile || echo -e 'nginx: nginx -p $PWD -c $PWD/nginx.conf -e error.log -g \"pid nginx.pid;daemon off;\"\\n' >> Procfile", diff --git a/php/src/helpers.rs b/php/src/helpers.rs index e7af109..4bb5b53 100644 --- a/php/src/helpers.rs +++ b/php/src/helpers.rs @@ -171,11 +171,11 @@ pub fn setup() -> Result { ])? .with_exec(vec!["cp ../composer.json ."])? .with_exec(vec!["cp ../composer.lock ."])? - .with_exec(vec!["[ -f ../php.ini ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/php/php.ini -O ../php.ini"])? + .with_exec(vec!["[ -f ../php.ini ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/php/php.ini -O ../php.ini"])? .with_exec(vec![r#"grep -q extension_dir ../php.ini || echo -e "\nextension_dir = \"$(ls -d .flox/run/*/lib/php/extensions)\"" >> ../php.ini"#])? .with_exec(vec!["composer", "install"])? .with_exec(vec!["rm -rf ../vendor && mv vendor .."])? - .with_exec(vec!["[ -f ../php-fpm.conf ] || wget https://raw.githubusercontent.com/fluentci-io/services/main/php/php-fpm.conf -O ../php-fpm.conf"])? + .with_exec(vec!["[ -f ../php-fpm.conf ] || flox activate -- wget https://raw.githubusercontent.com/fluentci-io/services/main/php/php-fpm.conf -O ../php-fpm.conf"])? .with_exec(vec![ "grep -q php-fpm Procfile || echo -e 'php-fpm: php-fpm -y ../php-fpm.conf --nodaemonize\\n' >> Procfile", ])? diff --git a/vault/src/helpers.rs b/vault/src/helpers.rs index 2bcbdbd..231323d 100644 --- a/vault/src/helpers.rs +++ b/vault/src/helpers.rs @@ -57,7 +57,7 @@ pub fn setup() -> Result { "[ -d ../data ] || mkdir -p ../data", ])? .with_exec(vec!["[ -f config.hcl.template ] || pkgx wget https://raw.githubusercontent.com/fluentci-io/services/main/vault/config.hcl.template"])? - .with_exec(vec!["[ -f ../config.hcl ] || envsubst < config.hcl.template > ../config.hcl "])? + .with_exec(vec!["[ -f ../config.hcl ] || flox activate -- envsubst < config.hcl.template > ../config.hcl "])? .with_exec(vec![ "grep -q vault: Procfile || echo -e 'vault: vault server -config=../config.hcl \\n' >> Procfile", ])?