By Brew:
brew install chyroc/tap/anb
By Go:
go get github.com/chyroc/anb
id
: unique id for task, can be used with set-output commandif
if
args supportexist
function- and
!
,&&
,||
operator
dir
: support cmd and local_cmd task
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
server:
user: root
host: 1.2.3.4
tasks:
- name: "pull app"
if: exist("/app-path")
dir: app-path
local_cmd:
- git pull
- cmd
- local_cmd
- upload
- download
server:
user: root
host: 1.2.3.4
tasks:
- cmd: ls
- name: exec commands
cmd:
- ls
- ls -alh
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
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/
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/