nif ci fix complie in ci
This commit is contained in:
parent
de1ad8bc8a
commit
b663d484cf
5 changed files with 31 additions and 9 deletions
|
|
@ -44,3 +44,8 @@ erl_crash.dump
|
||||||
/assets/node_modules/
|
/assets/node_modules/
|
||||||
/priv/static/assets/
|
/priv/static/assets/
|
||||||
/priv/static/cache_manifest.json
|
/priv/static/cache_manifest.json
|
||||||
|
|
||||||
|
# Compiled NIF binaries - should be built in container for target architecture
|
||||||
|
/priv/*.so
|
||||||
|
/priv/*.dylib
|
||||||
|
/c_src/*.o
|
||||||
|
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -60,3 +60,8 @@ profiles.json
|
||||||
|
|
||||||
# Application MIB files (now committed to git and included in Docker image)
|
# Application MIB files (now committed to git and included in Docker image)
|
||||||
# Only ignore the top-level librenms mibs directory (symlink)
|
# Only ignore the top-level librenms mibs directory (symlink)
|
||||||
|
|
||||||
|
# Compiled NIF binaries (platform-specific, should be built in Docker)
|
||||||
|
/priv/*.so
|
||||||
|
/priv/*.dylib
|
||||||
|
/c_src/*.o
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ ENV TERM=dumb
|
||||||
# install build dependencies
|
# install build dependencies
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
|
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential git \
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential git libsnmp-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# prepare build dir
|
# prepare build dir
|
||||||
|
|
@ -63,6 +63,8 @@ RUN --mount=type=cache,target=/root/.mix \
|
||||||
|
|
||||||
COPY priv priv
|
COPY priv priv
|
||||||
|
|
||||||
|
COPY c_src c_src
|
||||||
|
|
||||||
COPY lib lib
|
COPY lib lib
|
||||||
|
|
||||||
# Compile the release
|
# Compile the release
|
||||||
|
|
@ -84,7 +86,7 @@ RUN mix release
|
||||||
FROM ${RUNNER_IMAGE} AS final
|
FROM ${RUNNER_IMAGE} AS final
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 locales ca-certificates iputils-ping snmp \
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 locales ca-certificates iputils-ping snmp libsnmp40 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Set the locale
|
# Set the locale
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ defmodule Towerops.Profiles.ProfileWatcher do
|
||||||
Uses FileSystem to monitor the priv/profiles directory for file changes.
|
Uses FileSystem to monitor the priv/profiles directory for file changes.
|
||||||
When a .yaml or .yml file is created, modified, or deleted, triggers
|
When a .yaml or .yml file is created, modified, or deleted, triggers
|
||||||
a reload of all profiles via YamlProfiles.reload/0.
|
a reload of all profiles via YamlProfiles.reload/0.
|
||||||
|
|
||||||
|
Note: Only available in development mode. FileSystem is a dev-only dependency.
|
||||||
"""
|
"""
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
||||||
|
|
@ -20,16 +22,24 @@ defmodule Towerops.Profiles.ProfileWatcher do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def init(_opts) do
|
def init(_opts) do
|
||||||
# Get the absolute path to the profiles directory
|
# Only start file watcher in development
|
||||||
profiles_path = Path.join(Application.app_dir(:towerops), @profiles_dir)
|
# FileSystem is a dev-only dependency
|
||||||
|
if Code.ensure_loaded?(FileSystem) do
|
||||||
|
# Get the absolute path to the profiles directory
|
||||||
|
profiles_path = Path.join(Application.app_dir(:towerops), @profiles_dir)
|
||||||
|
|
||||||
# Start watching the profiles directory for changes
|
# Start watching the profiles directory for changes
|
||||||
{:ok, watcher_pid} = FileSystem.start_link(dirs: [profiles_path])
|
{:ok, watcher_pid} = FileSystem.start_link(dirs: [profiles_path])
|
||||||
FileSystem.subscribe(watcher_pid)
|
FileSystem.subscribe(watcher_pid)
|
||||||
|
|
||||||
Logger.info("ProfileWatcher: Started watching #{profiles_path}")
|
Logger.info("ProfileWatcher: Started watching #{profiles_path}")
|
||||||
|
|
||||||
{:ok, %{watcher_pid: watcher_pid, profiles_path: profiles_path}}
|
{:ok, %{watcher_pid: watcher_pid, profiles_path: profiles_path}}
|
||||||
|
else
|
||||||
|
# In production, FileSystem is not available
|
||||||
|
Logger.debug("ProfileWatcher: FileSystem not available, running in no-op mode")
|
||||||
|
{:ok, %{}}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Reference in a new issue