From 1d3ad26ddbe3cce9aa07c63c645f86843f12cc55 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Wed, 24 Jul 2024 18:13:11 +0000 Subject: [PATCH] feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service feat: add neo4j service --- .github/workflows/neo4j.yml | 37 ++++ Cargo.lock | 10 ++ Cargo.toml | 2 + README.md | 1 + neo4j/Cargo.toml | 20 +++ neo4j/LICENSE | 19 ++ neo4j/README.md | 54 ++++++ neo4j/fluentci.toml | 11 ++ neo4j/neo4j.conf | 344 ++++++++++++++++++++++++++++++++++++ neo4j/src/helpers.rs | 31 ++++ neo4j/src/lib.rs | 43 +++++ neo4j/target | 1 + 12 files changed, 573 insertions(+) create mode 100644 .github/workflows/neo4j.yml create mode 100644 neo4j/Cargo.toml create mode 100644 neo4j/LICENSE create mode 100644 neo4j/README.md create mode 100644 neo4j/fluentci.toml create mode 100644 neo4j/neo4j.conf create mode 100644 neo4j/src/helpers.rs create mode 100644 neo4j/src/lib.rs create mode 120000 neo4j/target diff --git a/.github/workflows/neo4j.yml b/.github/workflows/neo4j.yml new file mode 100644 index 0000000..485a308 --- /dev/null +++ b/.github/workflows/neo4j.yml @@ -0,0 +1,37 @@ +name: ci +on: + push: + branches: + - main + paths: + - neo4j/** + - .github/workflows/neo4j.yml +jobs: + neo4j-test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Setup Fluent CI + uses: fluentci-io/setup-fluentci@v5 + with: + wasm: true + plugin: rust + args: | + target_add wasm32-unknown-unknown + build --release --target wasm32-unknown-unknown + working-directory: neo4j + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Start neo4j + run: | + fluentci run target/wasm32-unknown-unknown/release/neo4j.wasm start + fluentci ps + fluentci status neo4j + fluentci run target/wasm32-unknown-unknown/release/neo4j.wasm stop + working-directory: neo4j + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NIX_CONFIG: extra-access-tokens = github.com=${{ secrets.GH_ACCESS_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 6ad0ebd..327a0af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -507,6 +507,16 @@ dependencies = [ "fluentci-types", ] +[[package]] +name = "neo4j" +version = "0.1.0" +dependencies = [ + "anyhow", + "extism-pdk", + "fluentci-pdk", + "fluentci-types", +] + [[package]] name = "nginx" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 2374443..6262944 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ default-members = [ "mongodb", "mysql", "nats", + "neo4j", "nginx", "nsq", "opentelemetry-collector", @@ -80,6 +81,7 @@ members = [ "mongodb", "mysql", "nats", + "neo4j", "nginx", "nsq", "opentelemetry-collector", diff --git a/README.md b/README.md index 14140cd..f399370 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ fluentci run --wasm postgres start | [mongodb](./mongodb) | A general purpose, document-based, distributed database | | [mysql](./mysql) | The world's most popular open source database | | [nats](./nats) | A simple, secure and high performance messaging system | +| [neo4j](./neo4j) | A graph database management system | | [nginx](./nginx) | HTTP and reverse proxy server | | [nsq](./nsq) | A realtime distributed messaging platform | | [opentelemetry-collector](./opentelemetry-collector) | OpenTelemetry Collector superset with additional collectors | diff --git a/neo4j/Cargo.toml b/neo4j/Cargo.toml new file mode 100644 index 0000000..1ae9ada --- /dev/null +++ b/neo4j/Cargo.toml @@ -0,0 +1,20 @@ +[package] +authors = [ + "Tsiry Sandratraina ", +] +description = "Neo4j plugin for FluentCI" +edition = "2021" +license = "MIT" +name = "neo4j" +version = "0.1.0" + +[lib] +crate-type = [ + "cdylib", +] + +[dependencies] +anyhow = "1.0.82" +extism-pdk = "1.1.0" +fluentci-pdk = "0.2.1" +fluentci-types = "0.1.7" diff --git a/neo4j/LICENSE b/neo4j/LICENSE new file mode 100644 index 0000000..515dd5f --- /dev/null +++ b/neo4j/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Tsiry Sandratraina + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/neo4j/README.md b/neo4j/README.md new file mode 100644 index 0000000..05bfc87 --- /dev/null +++ b/neo4j/README.md @@ -0,0 +1,54 @@ +# Neo4j Plugin + +[![fluentci pipeline](https://shield.fluentci.io/x/neo4j)](https://pkg.fluentci.io/neo4j) +[![ci](https://github.com/fluentci-io/services/actions/workflows/neo4j.yml/badge.svg)](https://github.com/fluentci-io/services/actions/workflows/neo4j.yml) + +Neo4j service plugin for FluentCI. + +## 🚀 Usage + +Add the following command to your CI configuration file: + +```bash +fluentci run --wasm neo4j start +``` + +## Functions + +| Name | Description | +| ------ | ------------------------------ | +| start | Start neo4j | +| stop | Stop neo4j | + +## Code Usage + +Add `fluentci-pdk` crate to your `Cargo.toml`: + +```toml +[dependencies] +fluentci-pdk = "0.2.1" +``` + +Use the following code to call the plugin: + +```rust +use fluentci_pdk::dag; + +// ... + +dag().call("https://pkg.fluentci.io/neo4j@v0.1.0?wasm=1", "start", vec![])?; +``` + +## 📚 Examples + +Github Actions: + +```yaml +- name: Setup Fluent CI CLI + uses: fluentci-io/setup-fluentci@v5 + with: + wasm: true + plugin: neo4j + args: | + start +``` diff --git a/neo4j/fluentci.toml b/neo4j/fluentci.toml new file mode 100644 index 0000000..47d5906 --- /dev/null +++ b/neo4j/fluentci.toml @@ -0,0 +1,11 @@ +[package] +authors = [ + "Tsiry Sandratraina ", +] +description = "Neo4j Plugin for FluentCI" +keywords = [ + "neo4j", +] +license = "MIT" +name = "neo4j" +version = "0.1.0" diff --git a/neo4j/neo4j.conf b/neo4j/neo4j.conf new file mode 100644 index 0000000..5e3c2ff --- /dev/null +++ b/neo4j/neo4j.conf @@ -0,0 +1,344 @@ +#***************************************************************** +# Neo4j configuration +# +# For more details and a complete list of settings, please see +# https://neo4j.com/docs/operations-manual/current/reference/configuration-settings/ +#***************************************************************** + +# The name of the default database +#initial.dbms.default_database=neo4j + +# Paths of directories in the installation. +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 +# `LOAD CSV` section of the manual for details. +server.directories.import=import + +# Whether requests to Neo4j are authenticated. +# To disable authentication, uncomment this line +#dbms.security.auth_enabled=false + +# Anonymous usage data reporting +# To disable, uncomment this line +#dbms.usage_report.enabled=false + +#******************************************************************** +# Memory Settings +#******************************************************************** +# +# Memory settings are specified kibibytes with the 'k' suffix, mebibytes with +# 'm' and gibibytes with 'g'. +# If Neo4j is running on a dedicated server, then it is generally recommended +# to leave about 2-4 gigabytes for the operating system, give the JVM enough +# heap to hold all your transaction state and query context, and then leave the +# rest for the page cache. + +# Java Heap Size: by default the Java heap size is dynamically calculated based +# on available system resources. Uncomment these lines to set specific initial +# and maximum heap size. +#server.memory.heap.initial_size=512m +#server.memory.heap.max_size=512m + +# The amount of memory to use for mapping the store files. +# The default page cache memory assumes the machine is dedicated to running +# Neo4j, and is heuristically set to 50% of RAM minus the Java heap size. +#server.memory.pagecache.size=10g + +# Limit the amount of memory that all of the running transaction can consume. +# The default value is 70% of the heap size limit. +#dbms.memory.transaction.total.max=256m + +# Limit the amount of memory that a single transaction can consume. +# By default there is no limit. +#db.memory.transaction.max=16m + +#***************************************************************** +# Network connector configuration +#***************************************************************** + +# With default configuration Neo4j only accepts local connections. +# To accept non-local connections, uncomment this line: +#server.default_listen_address=0.0.0.0 + +# You can also choose a specific network interface, and configure a non-default +# port for each connector, by setting their individual listen_address. + +# The address at which this server can be reached by its clients. This may be the server's IP address or DNS name, or +# it may be the address of a reverse proxy which sits in front of the server. This setting may be overridden for +# individual connectors below. +#server.default_advertised_address=localhost + +# You can also choose a specific advertised hostname or IP address, and +# configure an advertised port for each connector, by setting their +# individual advertised_address. + +# By default, encryption is turned off. +# To turn on encryption, an ssl policy for the connector needs to be configured +# Read more in SSL policy section in this file for how to define a SSL policy. + +# Bolt connector +server.bolt.enabled=true +#server.bolt.tls_level=DISABLED +#server.bolt.listen_address=:7687 +#server.bolt.advertised_address=:7687 + +# HTTP Connector. There can be zero or one HTTP connectors. +server.http.enabled=true +#server.http.listen_address=:7474 +#server.http.advertised_address=:7474 + +# HTTPS Connector. There can be zero or one HTTPS connectors. +server.https.enabled=false +#server.https.listen_address=:7473 +#server.https.advertised_address=:7473 + +# Number of Neo4j worker threads. +#server.threads.worker_count= + +#***************************************************************** +# SSL policy configuration +#***************************************************************** + +# Each policy is configured under a separate namespace, e.g. +# dbms.ssl.policy..* +# can be any of 'bolt', 'https', 'cluster' or 'backup' +# +# The scope is the name of the component where the policy will be used +# Each component where the use of an ssl policy is desired needs to declare at least one setting of the policy. +# Allowable values are 'bolt', 'https', 'cluster' or 'backup'. + +# E.g if bolt and https connectors should use the same policy, the following could be declared +# dbms.ssl.policy.bolt.base_directory=certificates/default +# dbms.ssl.policy.https.base_directory=certificates/default +# However, it's strongly encouraged to not use the same key pair for multiple scopes. +# +# N.B: Note that a connector must be configured to support/require +# SSL/TLS for the policy to actually be utilized. +# +# see: dbms.connector.*.tls_level + +# SSL settings (dbms.ssl.policy..*) +# .base_directory Base directory for SSL policies paths. All relative paths within the +# SSL configuration will be resolved from the base dir. +# +# .private_key A path to the key file relative to the '.base_directory'. +# +# .private_key_password The password for the private key. +# +# .public_certificate A path to the public certificate file relative to the '.base_directory'. +# +# .trusted_dir A path to a directory containing trusted certificates. +# +# .revoked_dir Path to the directory with Certificate Revocation Lists (CRLs). +# +# .verify_hostname If true, the server will verify the hostname that the client uses to connect with. In order +# for this to work, the server public certificate must have a valid CN and/or matching +# Subject Alternative Names. +# +# .client_auth How the client should be authorized. Possible values are: 'none', 'optional', 'require'. +# +# .tls_versions A comma-separated list of allowed TLS versions. By default only TLSv1.2 is allowed. +# +# .trust_all Setting this to 'true' will ignore the trust truststore, trusting all clients and servers. +# Use of this mode is discouraged. It would offer encryption but no security. +# +# .ciphers A comma-separated list of allowed ciphers. The default ciphers are the defaults of +# the JVM platform. + +# Bolt SSL configuration +#dbms.ssl.policy.bolt.enabled=true +#dbms.ssl.policy.bolt.base_directory=certificates/bolt +#dbms.ssl.policy.bolt.private_key=private.key +#dbms.ssl.policy.bolt.public_certificate=public.crt +#dbms.ssl.policy.bolt.client_auth=NONE + +# Https SSL configuration +#dbms.ssl.policy.https.enabled=true +#dbms.ssl.policy.https.base_directory=certificates/https +#dbms.ssl.policy.https.private_key=private.key +#dbms.ssl.policy.https.public_certificate=public.crt +#dbms.ssl.policy.https.client_auth=NONE + +# Cluster SSL configuration +#dbms.ssl.policy.cluster.enabled=true +#dbms.ssl.policy.cluster.base_directory=certificates/cluster +#dbms.ssl.policy.cluster.private_key=private.key +#dbms.ssl.policy.cluster.public_certificate=public.crt + +# Backup SSL configuration +#dbms.ssl.policy.backup.enabled=true +#dbms.ssl.policy.backup.base_directory=certificates/backup +#dbms.ssl.policy.backup.private_key=private.key +#dbms.ssl.policy.backup.public_certificate=public.crt + +#***************************************************************** +# Logging configuration +#***************************************************************** + +# To enable HTTP logging, uncomment this line +#dbms.logs.http.enabled=true + +# To enable GC Logging, uncomment this line +#server.logs.gc.enabled=true + +# GC Logging Options +# see https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID-BE93ABDC-999C-4CB5-A88B-1994AAAC74D5 +#server.logs.gc.options=-Xlog:gc*,safepoint,age*=trace + +# Number of GC logs to keep. +#server.logs.gc.rotation.keep_number=5 + +# Size of each GC log that is kept. +#server.logs.gc.rotation.size=20m + +#***************************************************************** +# Miscellaneous configuration +#***************************************************************** + +# Determines if Cypher will allow using file URLs when loading data using +# `LOAD CSV`. Setting this value to `false` will cause Neo4j to fail `LOAD CSV` +# clauses that load data from the file system. +#dbms.security.allow_csv_import_from_file_urls=true + + +# Value of the Access-Control-Allow-Origin header sent over any HTTP or HTTPS +# connector. This defaults to '*', which allows broadest compatibility. Note +# that any URI provided here limits HTTP/HTTPS access to that URI only. +#dbms.security.http_access_control_allow_origin=* + +# Value of the HTTP Strict-Transport-Security (HSTS) response header. This header +# tells browsers that a webpage should only be accessed using HTTPS instead of HTTP. +# It is attached to every HTTPS response. Setting is not set by default so +# 'Strict-Transport-Security' header is not sent. Value is expected to contain +# directives like 'max-age', 'includeSubDomains' and 'preload'. +#dbms.security.http_strict_transport_security= + +# Retention policy for transaction logs needed to perform recovery and backups. +db.tx_log.rotation.retention_policy=2 days 2G + +# Whether or not any database on this instance are read_only by default. +# If false, individual databases may be marked as read_only using dbms.database.read_only. +# If true, individual databases may be marked as writable using dbms.databases.writable. +#dbms.databases.default_to_read_only=false + +# Comma separated list of JAX-RS packages containing JAX-RS resources, one +# package name for each mountpoint. The listed package names will be loaded +# under the mountpoints specified. Uncomment this line to mount the +# org.neo4j.examples.server.unmanaged.HelloWorldResource.java from +# neo4j-server-examples under /examples/unmanaged, resulting in a final URL of +# http://localhost:7474/examples/unmanaged/helloworld/{nodeId} +#server.unmanaged_extension_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged + +# A comma separated list of procedures and user defined functions that are allowed +# full access to the database through unsupported/insecure internal APIs. +#dbms.security.procedures.unrestricted=my.extensions.example,my.procedures.* + +# A comma separated list of procedures to be loaded by default. +# Leaving this unconfigured will load all procedures found. +#dbms.security.procedures.allowlist=apoc.coll.*,apoc.load.*,gds.* + +#******************************************************************** +# JVM Parameters +#******************************************************************** + +# G1GC generally strikes a good balance between throughput and tail +# latency, without too much tuning. +server.jvm.additional=-XX:+UseG1GC + +# Have common exceptions keep producing stack traces, so they can be +# debugged regardless of how often logs are rotated. +server.jvm.additional=-XX:-OmitStackTraceInFastThrow + +# Make sure that `initmemory` is not only allocated, but committed to +# the process, before starting the database. This reduces memory +# fragmentation, increasing the effectiveness of transparent huge +# pages. It also reduces the possibility of seeing performance drop +# due to heap-growing GC events, where a decrease in available page +# cache leads to an increase in mean IO response time. +# Try reducing the heap memory, if this flag degrades performance. +server.jvm.additional=-XX:+AlwaysPreTouch + +# Trust that non-static final fields are really final. +# This allows more optimizations and improves overall performance. +# NOTE: Disable this if you use embedded mode, or have extensions or dependencies that may use reflection or +# serialization to change the value of final fields! +server.jvm.additional=-XX:+UnlockExperimentalVMOptions +server.jvm.additional=-XX:+TrustFinalNonStaticFields + +# Disable explicit garbage collection, which is occasionally invoked by the JDK itself. +server.jvm.additional=-XX:+DisableExplicitGC + +# Restrict size of cached JDK buffers to 1 KB +server.jvm.additional=-Djdk.nio.maxCachedBufferSize=1024 + +# More efficient buffer allocation in Netty by allowing direct no cleaner buffers. +server.jvm.additional=-Dio.netty.tryReflectionSetAccessible=true + +# Exits JVM on the first occurrence of an out-of-memory error. Its preferable to restart VM in case of out of memory errors. +# server.jvm.additional=-XX:+ExitOnOutOfMemoryError + +# Expand Diffie Hellman (DH) key size from default 1024 to 2048 for DH-RSA cipher suites used in server TLS handshakes. +# This is to protect the server from any potential passive eavesdropping. +server.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048 + +# This mitigates a DDoS vector. +server.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true + +# Enable remote debugging +#server.jvm.additional=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 + +# This filter prevents deserialization of arbitrary objects via java object serialization, addressing potential vulnerabilities. +# By default this filter whitelists all neo4j classes, as well as classes from the hazelcast library and the java standard library. +# These defaults should only be modified by expert users! +# For more details (including filter syntax) see: https://openjdk.java.net/jeps/290 +#server.jvm.additional=-Djdk.serialFilter=java.**;org.neo4j.**;com.neo4j.**;com.hazelcast.**;net.sf.ehcache.Element;com.sun.proxy.*;org.openjdk.jmh.**;!* + +# Increase the default flight recorder stack sampling depth from 64 to 256, to avoid truncating frames when profiling. +server.jvm.additional=-XX:FlightRecorderOptions=stackdepth=256 + +# Allow profilers to sample between safepoints. Without this, sampling profilers may produce less accurate results. +server.jvm.additional=-XX:+UnlockDiagnosticVMOptions +server.jvm.additional=-XX:+DebugNonSafepoints + +# Open modules for neo4j to allow internal access +server.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED +server.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED +server.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED + +# Enable access to JDK vector API +# server.jvm.additional=--add-modules=jdk.incubator.vector + +# Disable logging JMX endpoint. +server.jvm.additional=-Dlog4j2.disable.jmx=true + +# Limit JVM metaspace and code cache to allow garbage collection. Used by cypher for code generation and may grow indefinitely unless constrained. +# Useful for memory constrained environments +#server.jvm.additional=-XX:MaxMetaspaceSize=1024m +#server.jvm.additional=-XX:ReservedCodeCacheSize=512m + +# Allow big methods to be JIT compiled. +# Useful for big queries and big expressions where cypher code generation can create large methods. +#server.jvm.additional=-XX:-DontCompileHugeMethods + +#******************************************************************** +# Wrapper Windows NT/2000/XP Service Properties +#******************************************************************** +# WARNING - Do not modify any of these properties when an application +# using this configuration file has been installed as a service. +# Please uninstall the service before modifying this section. The +# service can then be reinstalled. + +# Name of the service +server.windows_service_name=neo4j + +#******************************************************************** +# Other Neo4j system properties +#******************************************************************** \ No newline at end of file diff --git a/neo4j/src/helpers.rs b/neo4j/src/helpers.rs new file mode 100644 index 0000000..5f3ccbe --- /dev/null +++ b/neo4j/src/helpers.rs @@ -0,0 +1,31 @@ +use anyhow::Error; +use fluentci_pdk::dag; + +pub fn setup() -> Result { + dag() + .pipeline("setup")? + .with_exec(vec!["mkdir", "-p", ".fluentci/neo4j"])? + .stdout()?; + + let pwd = dag().get_env("PWD")?; + dag().set_envs(vec![ + ("NEO4J_CONF".into(), format!("{}", pwd)), + ("NEO4J_HOME".into(), format!("{}/neo4j", pwd)), + ])?; + + let stdout = dag() + .devbox()? + .with_workdir(".fluentci/neo4j")? + .with_exec(vec!["devbox", "add", "neo4j", "overmind", "tmux"])? + .with_exec(vec![ + "cp -r `realpath .devbox/nix/profile/default/share/neo4j` ../..", + ])? + .with_exec(vec!["chmod u+rw -R ../../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![ + "grep -q neo4j: Procfile || echo -e 'neo4j: devbox run neo4j console $NEO4J_ARGS \\n' >> Procfile", + ])? + .stdout()?; + + Ok(stdout) +} diff --git a/neo4j/src/lib.rs b/neo4j/src/lib.rs new file mode 100644 index 0000000..fa89a93 --- /dev/null +++ b/neo4j/src/lib.rs @@ -0,0 +1,43 @@ +use extism_pdk::*; +use fluentci_pdk::dag; + +pub mod helpers; + +#[plugin_fn] +pub fn start(_args: String) -> FnResult { + helpers::setup()?; + + let stdout = dag() + .devbox()? + .with_workdir(".fluentci/neo4j")? + .with_exec(vec!["overmind", "--version"])? + .with_exec(vec!["type", "overmind"])? + .with_exec(vec!["type neo4j"])? + .with_exec(vec!["neo4j --version"])? + .with_exec(vec![ + "overmind start -f Procfile --daemonize || devbox run overmind restart neo4j", + ])? + .wait_on(7474, None)? + .wait_on(7687, None)? + .with_exec(vec!["overmind", "status"])? + .stdout()?; + Ok(stdout) +} + +#[plugin_fn] +pub fn stop(args: String) -> FnResult { + helpers::setup()?; + + let args = if args.is_empty() { + "neo4j".to_string() + } else { + args + }; + + let stdout = dag() + .devbox()? + .with_workdir(".fluentci/neo4j")? + .with_exec(vec!["overmind", "stop", &args])? + .stdout()?; + Ok(stdout) +} diff --git a/neo4j/target b/neo4j/target new file mode 120000 index 0000000..78bc337 --- /dev/null +++ b/neo4j/target @@ -0,0 +1 @@ +../target \ No newline at end of file