Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

fpm controller feature #33

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions FPM.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ implements: fifthtry.github.io/theme
- `fpm diff`: /diff/
- `fpm update`: /update/
- `fpm serve`: /serve/
- `fpm install`: /cli/install/



Expand Down Expand Up @@ -99,6 +100,7 @@ implements: fifthtry.github.io/theme
- Journal: /journal/
- Contribution Guide: /dev/contribute/
- How Versioning Works: /dev/versioning/
- FPM Controller Support: /dev/controller/
- What is `FPM.manifest.ftd`?: /dev/fpm-manifest/
- File System Organization: /fs/
- `FPM.ftd`: /fpm-ftd-file/
Expand Down
52 changes: 52 additions & 0 deletions cli/install.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-- ft.page: `fpm install`

`fpm install` installs all the dependencies of current package.

-- ft.h2: Synopsis

-- ft.code:
lang: sh

fpm install
fpm install <package name> # TODO
fpm install <git url> # TODO
fpm install <tarball file> # TODO
fpm install <tarball url> # TODO
fpm install <github username>/<github project> # TODO

aliases: add, i, install


-- ft.h2: Description

`fpm install` installs the package and any packages that it depends on.

A `package` is:

- a) a folder that contains `FPM.ftd`
- b) a gzipped tarball containing (a)
- c) a url that resolves to (b)
- d) a <git remote url> that resolves to (a)

- `fpm install` install


Install the dependencies to local `.packages` folder. By default, `fpm install`
will install all packages listed as dependencies in `FPM.ftd` file.


- `fpm install <package name>`


- `fpm install <tarball file>`

Install a package that is sitting on your file system.

Tarball requirements:
- The filename must use .tar, .tar.gz, or .tgz as the extension.


- `fpm install <tarball url>`

Fetch the tarball url, and then install it. The url must start with `http://` or
`https://`
41 changes: 41 additions & 0 deletions dev/controller.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
-- ft.page: FPM Controller Support

FPM cli supports communication with [fpm
controller](https://github.com/FifthTry/fpm-controller). This is an optional
feature, and is only available when `controller` feature is enabled, which is
not enabled by default.

-- ft.h1: Controller Communication

When `controller` feature is enabled, `fpm serve` will first communicate with
the FPM controller service's `/get-package/` API.

-- ft.h2: FPM Controller Service Endpoint

The FPM Controller Service's enpoint is computed by using environement
variable `FPM_CONTROLLER`, which will look something like this:
`https://controller.fifthtry.com`, with the API path.

FPM Controller Service has more than one APIs: /get-package/ and /fpm-ready/.

-- ft.h1: `/get-package/`

Through an environemnt variable `FPM_INSTANCE_ID`, the `fpm serve` will learn
it's `instance id`, and it will pass the instance id to the `get-package` API.

The API returns the URL of the package to be downloaded, git repository URL and
the package name.

FPM will clone the git repository in the current directory. The current
directory will contain `FPM.ftd` and other files of the package.

FPM will then calls [`fpm install`](/cli/install/) on it.

-- ft.h1: `/fpm-ready/`

Once dependencies are ready `fpm` calls `/fpm-ready/` API on the controller. We
will pass the `FPM_INSTANCE_ID` and the git commit hash as input to the API

The API will return with success, and once it is done fpm will start receiving HTTP
traffic from the controller service.

6 changes: 2 additions & 4 deletions sitemap.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ from section, subsection and it's parent TOC. i.e. `key1: value1`, `key2: value2
`key3: value3`, `key4: value4` and `key5: value5`




-- ft.h1: Variable can be changed based on key value data

Using the `get-data`, the title can be different:
Expand All @@ -273,11 +271,11 @@ lang: ftd

# Overview

- foo/
- foo: foo/

# Development

- foo/-/1
- foo: foo/-/1
show-dev-info: true


Expand Down
2 changes: 0 additions & 2 deletions sync.ftd
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- ft.page: `fpm sync`


-- ft.markdown:

`fpm sync` operates in two modes. If the package is hosted on `fpm-repo` then it
syncs the content of local folder with remote [not yet implemented]. If the package
is hosted on `github` etc, then `sync` creates a snapshot of modified files in
Expand Down