anb

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

anb

codecov go report card test status Apache-2.0 license Go.Dev reference Go project version

Install

By Brew:

brew install chyroc/tap/anb

By Go:

go get github.com/chyroc/anb

Usage

Task Command Args
  • id: unique id for task, can be used with set-output command
  • if
    • if args support exist function
    • and !, &&, || operator
  • dir: support cmd and local_cmd task
run task if path not exist
server:
  user: root
  host: 1.2.3.4
tasks:
  - name: "clone app"
    if: |
      !exist("/app-path")
    local_cmd:
      - git clone https://github.com/user/repo app-path
run task if path exist && run command in dir
server:
  user: root
  host: 1.2.3.4
tasks:
  - name: "pull app"
    if: exist("/app-path")
    dir: app-path
    local_cmd:
      - git pull
Support Multi Task
  • cmd
  • local_cmd
  • upload
  • download
exec server command
server:
  user: root
  host: 1.2.3.4
tasks:
  - cmd: ls
  - name: exec commands
    cmd:
      - ls
      - ls -alh
exec local command
server:
  user: root
  host: 1.2.3.4
tasks:
  - name: exec local command
    local_cmd: go build -o /tmp/bin-file main.go
  - name: exec server commands
    cmd:
      - ls
upload files from local to server
server:
  user: root
  host: 1.2.3.4
tasks:
  - name: "upload file"
    upload:
      src: README.md
      dest: /tmp/README.md
  - name: "upload dir"
    upload:
      src: ./config/
      dest: /tmp/config/
download files from server to local
server:
  user: root
  host: 1.2.3.4
tasks:
  - name: "download file"
    upload:
      src: /tmp/server-README.md
      dest: /tmp/local-README.md
  - name: "upload dir"
    upload:
      src: /tmp/server-config/
      dest: /tmp/local-config/

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL