Categorygithub.com/juxuny/webhook
modulepackage
1.0.1
Repository: https://github.com/juxuny/webhook.git
Documentation: pkg.go.dev

# README

Webhook

A simple auto deploy tools.

Requirement

  • setup GOPATH and GOROOT environment variables
  • go 1.18+
  • ubuntu / linux / debian

Installation (for Ubuntu/Linux)

  1. install binary
go install github.com/juxuny/webhook@latest
  1. create a linux service config file in /etc/systemd/system
[Unit]
Description=Webhook
After=network.target

[Service]
Type=simple
User=juxuny
Restart=on-failure
RestartSec=5s
ExecStart=/mnt/tools/gopath/bin/webhook serve -c /home/juxuny/.config/webhook/config.yaml

[Install]
WantedBy=multi-user.target

Notice: You should modify the real path for yourself.

  1. create a YAML config file, look like this:
port: 20089
url-prefix: /hook
auth:
  - name: nuc
    token: {{token}}
deployments:
  - name: test-api-dev
    bash-interpreter: /bin/bash
    work-dir: .
    variables:
      - name: tag
        nullable: false
        type: string
    scripts:
      - test.sh

  1. enable the system service
sudo systemctl daemon-reload
sudo systemctl enable webhook
  1. check running status
sudo service webhook status
  1. trigger the deployment
curl -X POST -d 'tag=test-api-dev' http://127.0.0.1:20089/hook/test-api-dev

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author

# Structs

No description provided by the author