Skip to content

Nadleeh Usage

Install or Upgrade

If you are root user, you can run the following command:

Bash
curl -sL https://gundamz.net/nadleeh/install.sh | bash

If your are not root user, you can run the following command:

Bash
curl -sL https://gundamz.net/nadleeh/install.sh | sudo bash

Uninstall

Bash
rm -rf /usr/local/bin/nadleeh
rm -rf /var/log/nadleeh
rm -rf ~/.nadleeh

Workflows

A workflow is a YAML file that contains a list of tasks to be executed. It can be stored in the local file system or in a remote repository. See Example for more details.

Local Workflow

A local workflow is a workflow file that is stored in the local file system.

Bash
nadleeh run -f ./path/to/workflow.yml

Remote Workflow

A remote workflow is a workflow file that is stored in a remote repository. It supports the following providers:

  1. GitHub provider

    Bash
    nadleeh run -f <owner>/<repo>/path/to/workflow.yml -p github
    

    Where the github providers is a file defined in the ~/.nadleeh/providers/github, with the following content:

    YAML
    type: github  # required
    server: https://github.com  # optional. Required for enterprise github
    cred:  # requried for private repository
    type: Bearer
    username: ""
    password: <token>
    # you can specify the owner and repo, or specify in the workflow file path
    owner: <owner>  # optional
    repo: <repo>  # optional
    
  2. HTTPs provider

    Bash
    nadleeh run -f path1/path2/envs.yml -a ARG1=tests -p https
    

    Where the https providers is a file defined in the ~/.nadleeh/providers/https, with the following content:

    YAML
    type: https  # required
    url: <url>  # required
    cred:  # requried if the url is needed authentication
    type: <basic|bearer>  # required
    username: "<username>"
    password: "<token or password>"
    

Workflow Config file

The workflow config file is a YAML file that contains the workflow configuration. For example,

YAML
# workflow.wf
#!/usr/bin/env -S nadleeh wf

workflow: <owner>/<repo>/path/to/workflow.yml
provider: auth-github  # optional
private: /path/workflow-private.pem  # optional
args:  # optional
    arg1: value1
    arg2: value2

You can run it with:

Bash
chmod +x workflow.wf

# with arguments
./workflow.wf -a ARG1=value1 -a ARG2=value2 
# or without arguments
./workflow.wf

This can create workflow commands shortcuts.

Example

  1. Workflow file from nadleehz/workflows repository - Check the environment and arguments

    Bash
    nadleeh run -f @envs.yml -a ARG1=tests -p github
    

    The extension .yml can be omitted. The nadleeh will automatically add it. .yaml is also a valid extension. The provider github doesn't need to be exists for public GitHub repository.

  2. Workflow file from non-offical repository

    Bash
    nadleeh run -f <owner>/<repo>/path/to/workflow.yml -a ARG1=tests -p auth-github
    

Reference