placeos-frontend-loader

Version, currently 0.6.168 versions

github.com/PlaceOS/frontend-loader

PlaceOS sidecar service for managing frontends.

0 stars
0 dependents
License: MIT

Nothing has been indexed for 0.6.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  placeos-frontend-loader:
    github: PlaceOS/frontend-loader
    version: ~> 0.6.1

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.6.1. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

PlaceOS Frontend Loader

Build CI Changelog

suprisingly, a frontend loader!

An application Intended to be a sidecar to a webserver that listens for published front-end repositories and clones them to the webserver's static folder. The loader can also be configured to update via a CRON.

Included in this repo is an alpine based Dockerfile.

Usage

  • Specify the your static content path via the PLACE_LOADER_WWW environment variable, or the --www flag.

  • Ensure that the content directory is on a shared volume with the webserver.

  • A repository pinned to HEAD will be kept up to date automatically.

  • If a repository commit is specified it will held at that commit.

  • Configuring the update frequency is done via a CRON in PLACE_LOADER_CRON environment variable, or the --update-cron flag. Use crontab guru to validate your CRONs!!!

Client

Included is a simple client that can be configured via the PLACE_LOADER_URI environment variable.

require "placeos-frontend-loader/client"

# One-shot
commits = PlaceOS::FrontendLoader::Client.client do |client|
    client.commits("backoffice")
end

commits # => ["fac3caf3", ...]

# Instance
client = PlaceOS::Frontends::Client.new
client.commits("backoffice") # => ["fac3caf3", ...]
client.loaded # => {"backoffice" => "fac3caf3"...}
client.close

Routes

  • GET ../frontends/v1/repositories/:id/commits: returns a list of commits
  • GET ../frontends/v1/repositories/: return the loaded frontends and their current commit

Contributing

See CONTRIBUTING.md.

Contributors