Skip to content

Commit

Permalink
feat: add neo4j service
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jul 24, 2024
1 parent b04544f commit 86cc5f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions neo4j/neo4j.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#initial.dbms.default_database=neo4j

# Paths of directories in the installation.
server.directories.data=neo4j/data
server.directories.plugins=neo4j/plugins
server.directories.logs=neo4j/logs
server.directories.lib=neo4j/lib
server.directories.run=neo4j/run
server.directories.licenses=neo4j/licenses
server.directories.transaction.logs.root=neo4j/data/transactions
server.directories.data=data
server.directories.plugins=plugins
server.directories.logs=logs
server.directories.lib=lib
server.directories.run=run
server.directories.licenses=licenses
server.directories.transaction.logs.root=data/transactions

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to
# allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the
Expand Down
9 changes: 5 additions & 4 deletions neo4j/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ pub fn setup() -> Result<String, Error> {
.with_exec(vec!["mkdir", "-p", ".fluentci/neo4j"])?
.stdout()?;

let pwd = dag().get_env("PWD")?;
dag().set_envs(vec![
("NEO4J_CONF".into(), "../../neo4j.conf".into()),
("NEO4J_HOME".into(), "../../neo4j".into()),
])?;

let stdout = dag()
.devbox()?
Expand All @@ -16,11 +19,9 @@ pub fn setup() -> Result<String, Error> {
.with_exec(vec![
"cp -r `realpath .devbox/nix/profile/default/share/neo4j` ../..",
])?
.with_exec(vec!["pwd"])?
.with_exec(vec!["ls -l .devbox/nix/profile/default/share/*", "../../neo4j"])?
.with_exec(vec!["[ -f ../../neo4j.conf ] || pkgx wget https://raw.githubusercontent.com/fluentci-io/services/main/neo4j/neo4j.conf -O ../../neo4j.conf"])?
.with_exec(vec![
&format!("grep -q neo4j: Procfile || echo -e 'neo4j: NEO4J_CONF=\"{}\" NEO4J_HOME=\"{}/neo4j\" devbox run neo4j console $NEO4J_ARGS \\n' >> Procfile", pwd, pwd),
"grep -q neo4j: Procfile || echo -e 'neo4j: devbox run neo4j console $NEO4J_ARGS \\n' >> Procfile",
])?
.stdout()?;

Expand Down

0 comments on commit 86cc5f5

Please sign in to comment.