Skip to content

Commit

Permalink
fix: always activate flox environment
Browse files Browse the repository at this point in the history
fix: always activate flox environment
  • Loading branch information
tsirysndr committed Jul 16, 2024
1 parent 1cf0720 commit 5ba7f3f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions apache/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ pub fn setup() -> Result<String, Error> {
.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",
])?
Expand Down
4 changes: 2 additions & 2 deletions caddy/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ pub fn setup() -> Result<String, Error> {
.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),
])?
Expand Down
4 changes: 2 additions & 2 deletions consul/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pub fn setup() -> Result<String, Error> {
.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 -- sh -c \"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",
])?
Expand Down
8 changes: 4 additions & 4 deletions nginx/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ pub fn setup() -> Result<String, Error> {
.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 -- sh -c \"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",
Expand Down
4 changes: 2 additions & 2 deletions php/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ pub fn setup() -> Result<String, Error> {
])?
.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",
])?
Expand Down
2 changes: 1 addition & 1 deletion vault/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn setup() -> Result<String, Error> {
"[ -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 -- sh -c \"envsubst < config.hcl.template\" > ../config.hcl "])?
.with_exec(vec![
"grep -q vault: Procfile || echo -e 'vault: vault server -config=../config.hcl \\n' >> Procfile",
])?
Expand Down

0 comments on commit 5ba7f3f

Please sign in to comment.