0.36.2 • Published 2 months ago

@fnet/cli v0.36.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 months ago

:warning: Warning

This tool is in its early stages of development. Changes in its usage are highly likely. Please use with caution.

@fnet/cli: Flow Node & Flow Project Setup Guide

Overview

The @fnet/cli is a command-line interface tool designed to facilitate the development and deployment of flow-based projects within the fnet ecosystem. It simplifies the processes of creating, managing, and deploying flow-based projects, acting as a bridge between developers and the fnet platform.

Prerequisites

Ensure you have @fnet/cli installed globally:

npm i @fnet/cli -g

Upon installation, two binary commands become available: fnet (for flow projects) and fnode (for flow node projects).

Identifying Project Type

  • Flow Node Project: Presence of node.yaml. Use fnode commands.
  • Flow Project: Presence of flow.yaml. Use fnet commands.

Building the Project

For Flow Node:

fnode build

For Flow:

fnet build

Both commands generate a .workspace directory with files and configurations for debugging, building, and deploying.

Watching the Project (Development Mode)

For Flow Node:

fnode watch

For Flow:

fnet watch

Deploying the Project

Ensure respective node.devops.yaml (for Flow Node) or flow.devops.yaml (for Flow) has the correct deployment configurations.

Configuration for NPM Deployment

Structure for devops.yaml:

targets:
  - name: npm
    enabled: true
    params:
        name: "NPM_PACKAGE_NAME"
        version: "NPM_VERSION"

Replace placeholders with desired npm package name and version.

For deployment:

For Flow Node:

fnode deploy

For Flow:

fnet deploy

NPM Configuration File:

The CLI checks for npm.fnet under the first .fnet directory (in the project root, parent directory, or user's home). The file format:

version: 1
type: fnet.config
env:
  NPM_TOKEN: "YOUR_NPM_TOKEN"

Replace YOUR_NPM_TOKEN with your npm token for deployment authentication.

Configuration for GCS Deployment

The @fnet/cli also facilitates deploying build packages directly to a Google Cloud Storage bucket.

To deploy to a Google Cloud Storage bucket, add a new target named gcs under the targets section in your devops.yaml:

targets:
  ...
  - name: gcs
    enabled: true
    params:
      name: "@flownet/lib-1"
      version: 0.1.2

Replace the placeholders with your package name and version accordingly.

GCS Configuration File:

For GCS deployment, the CLI looks for a gcs.fnet file under the first .fnet directory (either in the project root, parent directory, or user's home directory). The expected format of this file is:

version: 1
type: fnet.config
env:
  GCS_PROJECT_ID: "YOUR_PROJECT_ID"
  GCS_BUCKET_NAME: "YOUR_BUCKET_NAME"
  GCS_UPLOADER_KEY_FILE: "PATH_TO_YOUR_SERVICE_ACCOUNT_KEY_JSON"

Make sure to replace the placeholders with the appropriate values:

  • YOUR_PROJECT_ID: Your Google Cloud project ID.
  • YOUR_BUCKET_NAME: The name of the GCS bucket where you want to deploy.
  • PATH_TO_YOUR_SERVICE_ACCOUNT_KEY_JSON: Path to the service account key in JSON format, which has the necessary permissions to upload files to the specified bucket.

Configuration for GitLab Deployment

With the @fnet/cli, you can also deploy the contents of the .workspace directory directly to GitLab.

To deploy to GitLab, introduce a new target named gitlab under the targets section in your devops.yaml:

targets:
  ...
  - name: gitlab
    enabled: true
    params:
      name: PROJECT-NAME
      branch: BRANCH-NAME

Replace PROJECT-NAME with the name of your GitLab project and BRANCH-NAME with the branch where you want to deploy the contents.

GitLab Configuration File:

For the GitLab deployment, the CLI searches for a gitlab.fnet file under the first .fnet directory (either in the project root, parent directory, or user's home directory). The expected format for this file is:

version: 1
type: fnet.config
data:
  projectGroupId: "YOUR_PROJECT_GROUP_ID"
  gitlabHost: "YOUR_GITLAB_HOST"
  gitlabToken: "YOUR_GITLAB_TOKEN"
  gitlabUsername: "YOUR_USERNAME"
  gitlabUserEmail: "YOUR_EMAIL"

Make sure to replace the placeholders with the appropriate values:

  • YOUR_PROJECT_GROUP_ID: The ID of your GitLab project group.
  • YOUR_GITLAB_HOST: The hostname of your GitLab instance (e.g., "gitlab.com" for GitLab's public instance).
  • YOUR_GITLAB_TOKEN: Your GitLab personal access token.
  • YOUR_USERNAME: Your GitLab username.
  • YOUR_EMAIL: The email associated with your GitLab account.
0.36.2

2 months ago

0.36.1

3 months ago

0.36.0

3 months ago

0.35.1

3 months ago

0.35.0

3 months ago

0.34.1

3 months ago

0.34.0

4 months ago

0.33.6

4 months ago

0.33.5

4 months ago

0.33.4

4 months ago

0.33.3

4 months ago

0.33.2

4 months ago

0.33.0

4 months ago

0.32.3

4 months ago

0.32.2

4 months ago

0.32.1

4 months ago

0.32.0

4 months ago

0.30.3

4 months ago

0.31.5

4 months ago

0.31.4

4 months ago

0.31.3

4 months ago

0.31.2

4 months ago

0.31.1

4 months ago

0.31.0

4 months ago

0.30.2

4 months ago

0.29.2

4 months ago

0.30.1

4 months ago

0.29.1

4 months ago

0.29.0

5 months ago

0.28.5

5 months ago

0.28.4

5 months ago

0.28.3

5 months ago

0.27.6

5 months ago

0.27.5

5 months ago

0.27.4

5 months ago

0.27.3

5 months ago

0.28.1

5 months ago

0.28.0

5 months ago

0.27.2

6 months ago

0.27.1

6 months ago

0.27.0

6 months ago

0.26.0

6 months ago

0.25.0

6 months ago

0.24.0

6 months ago

0.23.2

6 months ago

0.23.1

6 months ago

0.23.0

6 months ago

0.22.2

6 months ago

0.22.1

6 months ago

0.22.0

6 months ago

0.21.2

7 months ago

0.21.1

7 months ago

0.21.0

7 months ago

0.20.3

7 months ago

0.20.2

7 months ago

0.20.1

7 months ago

0.19.8

7 months ago

0.19.7

7 months ago

0.19.6

7 months ago

0.19.5

7 months ago

0.19.3

7 months ago

0.19.2

7 months ago

0.19.1

7 months ago

0.19.0

7 months ago

0.18.4

7 months ago

0.18.2

7 months ago

0.18.1

7 months ago

0.18.0

7 months ago

0.17.2

7 months ago

0.17.1

7 months ago

0.17.0

7 months ago

0.16.1

7 months ago

0.16.0

7 months ago

0.15.0

7 months ago

0.14.9

7 months ago

0.14.7

7 months ago

0.14.6

7 months ago

0.14.5

7 months ago

0.14.4

7 months ago

0.14.3

7 months ago

0.14.2

7 months ago

0.14.1

7 months ago

0.13.2

7 months ago

0.13.1

7 months ago

0.13.0

7 months ago

0.12.0

8 months ago

0.11.0

8 months ago

0.10.0

8 months ago

0.9.13

8 months ago

0.9.12

8 months ago

0.9.11

8 months ago

0.9.10

8 months ago

0.9.9

8 months ago

0.9.8

8 months ago

0.9.7

8 months ago

0.9.6

8 months ago

0.9.5

8 months ago

0.9.4

8 months ago

0.9.2

8 months ago

0.9.0

8 months ago

0.8.9

8 months ago

0.8.7

8 months ago

0.8.5

8 months ago

0.8.4

8 months ago

0.8.1

8 months ago

0.8.0

8 months ago

0.7.7

8 months ago

0.7.6

8 months ago

0.7.5

8 months ago

0.7.4

8 months ago

0.7.3

8 months ago

0.7.2

8 months ago

0.7.1

8 months ago

0.7.0

8 months ago

0.6.3

8 months ago

0.6.2

8 months ago

0.6.1

8 months ago

0.6.0

8 months ago

0.5.8

8 months ago

0.5.7

8 months ago

0.5.6

8 months ago

0.5.5

8 months ago

0.5.4

8 months ago

0.5.3

8 months ago

0.5.1

8 months ago

0.4.26

8 months ago

0.4.25

8 months ago

0.4.24

8 months ago

0.4.23

8 months ago

0.4.22

8 months ago