gohotdeploy

command module
v0.0.0-...-ac4cbd7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

README

GoHotDeploy

GoHotDeploy is a lightweight tool that enables hot deployment of Go applications using GitLab Webhooks.

English | 简体中文

Usage

  1. Install GoHotDeploy:

    go get github.com/treeforest/gohotdeploy
    
  2. Create a configuration file config.yml with the following content:

    port: 8080
    repositories:
      my-repo:
        build_relative_dir: .
        build_args_bin: ""
    

    Replace . with the relative path to the build directory within your Git repository. If build_relative_dir is left empty, it defaults to the current directory of the repository.

    Modify the build_args_bin value to include the desired arguments to be passed when executing the built binary. If build_args_bin is left empty, no additional arguments will be passed during program execution.

  3. Start GoHotDeploy:

    gohotdeploy --config=config.yml
    

    GoHotDeploy will start an HTTP server listening on the specified port (default: 8080) for GitLab webhook events.

  4. Configure GitLab webhook:

    • Go to your GitLab project settings.
    • Navigate to "Webhooks" in the left sidebar.
    • Add a new webhook with the following settings:
      • URL: http://your-server-ip:8080/
      • Trigger: "Push events"
      • SSL verification: Enable or disable based on your server configuration
      • Save the webhook.

    Whenever a push event occurs in your GitLab repository, GoHotDeploy will automatically build and deploy your application.

License

GNU General Public License v3.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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