From 4522b3889779c6d867aa28503afdb3894bcde19d Mon Sep 17 00:00:00 2001 From: abrark Date: Fri, 8 Jul 2022 08:09:40 +0530 Subject: [PATCH 1/2] fpm-controller API docs --- FPM.ftd | 6 +++++ fpm-controller/apis/fpm-ready.ftd | 26 ++++++++++++++++++++++ fpm-controller/apis/get-package.ftd | 33 ++++++++++++++++++++++++++++ fpm-controller/index.ftd | 4 ++++ fpm-controller/update-fpm-binary.ftd | 16 ++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 fpm-controller/apis/fpm-ready.ftd create mode 100644 fpm-controller/apis/get-package.ftd create mode 100644 fpm-controller/index.ftd create mode 100644 fpm-controller/update-fpm-binary.ftd diff --git a/FPM.ftd b/FPM.ftd index f05bea22b..63a4eddb5 100644 --- a/FPM.ftd +++ b/FPM.ftd @@ -102,6 +102,12 @@ implements: fifthtry.github.io/theme - What is `FPM.manifest.ftd`?: /dev/fpm-manifest/ - File System Organization: /fs/ - `FPM.ftd`: /fpm-ftd-file/ + +- FPM Controller: /fpm-controller/ + - `fpm-ready` API: /fpm-controller/apis/fpm-ready/ + - `get-package` API: /fpm-controller/apis/get-package/ + - Update `fpm` Binary: /fpm-controller/update-fpm-binary/ + - Day To Day: - How To Run Tests: /day-to-day/how-to-run-tests/ - How To Update Failing Snapshot Tests: /day-to-day/how-to-fix-tests/ diff --git a/fpm-controller/apis/fpm-ready.ftd b/fpm-controller/apis/fpm-ready.ftd new file mode 100644 index 000000000..4707264dd --- /dev/null +++ b/fpm-controller/apis/fpm-ready.ftd @@ -0,0 +1,26 @@ +-- ft.page: `fpm-ready` API + +This API is get called from `fpm`, when the `fpm serve` is ready to serve the +package. + +-- ft.h1: API + +-- ft.h2: URL and Parameters + +URL of the API is: `/v1/fpm/fpm-ready` + +Query Parameters: `ec2_instance_id` and `git_hash`. + +-- ft.h2: Request Method + +Request Method of this API is `GET` + +-- ft.h2: Response + +The output of the API is: + +-- ft.code: +lang: json +{ + "success": true +} \ No newline at end of file diff --git a/fpm-controller/apis/get-package.ftd b/fpm-controller/apis/get-package.ftd new file mode 100644 index 000000000..70835282a --- /dev/null +++ b/fpm-controller/apis/get-package.ftd @@ -0,0 +1,33 @@ +-- ft.page: `get-package` API + +This API is get called from `fpm`, when it need to get the package to deploy +on the instance. + + +-- ft.h1: API + +-- ft.h2: URL and Parameters + +URL of the API is: `/v1/fpm/get-package` + +Query Parameter: `ec2_instance_id` + + +-- ft.h2: Request Method + +Request Method of this API is `GET` + +-- ft.h2: Response + +The output of the API is: + +-- ft.code: +lang: json +{ + "success": true, + "result": { + "package": "", + "git": "", + "base": "" + } +} \ No newline at end of file diff --git a/fpm-controller/index.ftd b/fpm-controller/index.ftd new file mode 100644 index 000000000..6f200530a --- /dev/null +++ b/fpm-controller/index.ftd @@ -0,0 +1,4 @@ +-- ft.page: FPM Controller + +FPM Controller is an entry service for any FPM package which is served by +FifthTry. \ No newline at end of file diff --git a/fpm-controller/update-fpm-binary.ftd b/fpm-controller/update-fpm-binary.ftd new file mode 100644 index 000000000..3bb41f4eb --- /dev/null +++ b/fpm-controller/update-fpm-binary.ftd @@ -0,0 +1,16 @@ +-- ft.h1: How to update `fpm` binary on ec2 instance + +-- ft.h2: `ssh` To `fpm` Instance + +-- ft.code: +lang: sh + +ssh -i @ + +-- ft.h2: On Virtual Machine Restart `fpm-app` + +-- ft.code: +lang: sh + +sudo systemctl restart fpm-app +journalctl -u fpm-app -ef # for log check of fpm-app \ No newline at end of file From a306e23f9aa5b138779cd69c6102368b10f28baf Mon Sep 17 00:00:00 2001 From: abrark Date: Fri, 8 Jul 2022 08:12:39 +0530 Subject: [PATCH 2/2] fixed broken page --- fpm-controller/update-fpm-binary.ftd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpm-controller/update-fpm-binary.ftd b/fpm-controller/update-fpm-binary.ftd index 3bb41f4eb..298f3ef86 100644 --- a/fpm-controller/update-fpm-binary.ftd +++ b/fpm-controller/update-fpm-binary.ftd @@ -1,4 +1,4 @@ --- ft.h1: How to update `fpm` binary on ec2 instance +-- ft.page: How to update `fpm` binary on ec2 instance -- ft.h2: `ssh` To `fpm` Instance