Skip to content

raoqu/deploy_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

文件上传自动部署

带有简易文件管理的自动部署工具

编译运行

cd deploy_go
go mod tidy

cd cmd
go build && ./cmd

使用

浏览器访问 http://localhost:8066/

配置文件

用户:user.json

[
    {"user": "admin", "password": "admin123456"}
]

部署规则:deploy.json

{
    "path": "./Upload",
    "env": {
        "blog": "~/web/blog",
        "blog_content": "~/web/blog/content",
        "web": "~/web/site",
        "upload": "~/Upload"
    },
    "items": [
        {
            "path": "*.png",
            "actions": [
                "echo file {$FILE} uploaded."
            ]
        },
        {
            "path": "*.go",
            "actions": [
                "dir {$FILE}"
            ]
        },
        {
            "path": "server",
            "actions": [
                "killall server",
                "mv {$FILE} {$web}",
                "{$web} => ./server &"
            ]
        },
        {
            "path": "post.zip",
            "actions": [
                "mv {$FILE} {$blog_content}",
                "killall hugo",
                "{$blog_content} => mv post_backup.zip -r post/ && rm -rf post/",
                "{$blog_content} => unzip {$FILE}",
                "killall hugo && hugo server &"
            ]
        }
    ]
}

About

文件上传自动部署工具

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published