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..298f3ef86 --- /dev/null +++ b/fpm-controller/update-fpm-binary.ftd @@ -0,0 +1,16 @@ +-- ft.page: 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