8000 GitHub - chyroc/anb
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chyroc/anb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/
0