Nerves v1.5.0 Nerves.Artifact View Source
Package artifacts are the product of compiling a package with a specific toolchain.
Link to this section Summary
Functions
Produces an archive of the package artifact which can be fetched when
calling nerves.artifact.get
.
Get the base dir for where an artifact for a package should be stored.
Builds the package and produces an See Nerves.Artifact for more information.
Get the path to where the artifact is built
Get the path where the global artifact will be linked to. This path is typically a location within build_path, but can be vary on different build platforms.
Produce a base16 encoded checksum for the package from the list of files and expanded folders listed in the checksum config key.
Cleans the artifacts for the package build_runners of all packages.
The full path to the artifact.
Get the artifact download name
Get the path to where the artifact archive is downloaded to.
Determine the environment variable which would be set to override the path.
Check to see if the artifact path is being set from the system env.
Expands the sites helpers from artifact_sites
in the nerves_package config.
Determines the extension for an artifact based off its type. Toolchains use xz compression.
Get the host_tuple for the package. Toolchains are specifically build to run
on a host for a target. Other packages are host agnostic for now. They are
marked as portable
.
Get the artifact name
Determines if the artifact for a package is stale and needs to be rebuilt.
Link to this section Functions
archive(pkg, toolchain, opts) View Source
Produces an archive of the package artifact which can be fetched when
calling nerves.artifact.get
.
base_dir()
View Source
base_dir() :: String.t()
base_dir() :: String.t()
Get the base dir for where an artifact for a package should be stored.
The base dir for an artifact will point
to the NERVES_ARTIFACTS_DIR or if undefined, ~/.nerves/artifacts
build(pkg, toolchain)
View Source
build(Nerves.Package.t(), Nerves.Package.t()) :: :ok
build(Nerves.Package.t(), Nerves.Package.t()) :: :ok
Builds the package and produces an See Nerves.Artifact for more information.
build_path(pkg) View Source
Get the path to where the artifact is built
build_path_link(pkg) View Source
Get the path where the global artifact will be linked to. This path is typically a location within build_path, but can be vary on different build platforms.
build_runner(config) View Source
checksum(pkg, opts \\ []) View Source
Produce a base16 encoded checksum for the package from the list of files and expanded folders listed in the checksum config key.
clean(pkg)
View Source
clean(Nerves.Package.t()) :: :ok | {:error, term()}
clean(Nerves.Package.t()) :: :ok | {:error, term()}
Cleans the artifacts for the package build_runners of all packages.
dir(pkg)
View Source
dir(Nerves.Package.t()) :: String.t()
dir(Nerves.Package.t()) :: String.t()
The full path to the artifact.
download_name(pkg, opts \\ []) View Source
Get the artifact download name
download_path(pkg) View Source
Get the path to where the artifact archive is downloaded to.
env_var(pkg)
View Source
env_var(Nerves.Package.t()) :: String.t()
env_var(Nerves.Package.t()) :: String.t()
Determine the environment variable which would be set to override the path.
env_var?(pkg)
View Source
env_var?(Nerves.Package.t()) :: boolean()
env_var?(Nerves.Package.t()) :: boolean()
Check to see if the artifact path is being set from the system env.
expand_sites(pkg) View Source
Expands the sites helpers from artifact_sites
in the nerves_package config.
Artifact sites can pass options as a third parameter for adding headers
or query string parameters. For example, if you are trying to resolve
artifacts hosted using :github_releases
in a private repo,
you can pass a personal access token into the sites helper.
{:github_releases, "my-organization/my_repository", query_params: %{"access_token" => System.get_env("GITHUB_ACCESS_TOKEN")}}
You can also use this to add an authorization header for files behind basic auth.
{:prefix, "http://my-organization.com/", headers: [{"Authorization", "Basic " <> System.get_env("BASIC_AUTH")}}]}
ext(arg1)
View Source
ext(Nerves.Package.t()) :: String.t()
ext(Nerves.Package.t()) :: String.t()
Determines the extension for an artifact based off its type. Toolchains use xz compression.
host_tuple(arg1) View Source
Get the host_tuple for the package. Toolchains are specifically build to run
on a host for a target. Other packages are host agnostic for now. They are
marked as portable
.
name(pkg)
View Source
name(Nerves.Package.t()) :: String.t()
name(Nerves.Package.t()) :: String.t()
Get the artifact name
parse_download_name(name) View Source
stale?(pkg)
View Source
stale?(Nerves.Package.t()) :: boolean()
stale?(Nerves.Package.t()) :: boolean()
Determines if the artifact for a package is stale and needs to be rebuilt.