GithubHelp home page GithubHelp logo

wuttinanhi / autodeploy Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 60 KB

automatic deploy to server from push

License: MIT License

Shell 0.83% JavaScript 99.17%
docker docker-compose deployment-automation deploy nodejs git

autodeploy's Introduction

AUTODEPLOY

a docker image listening for commit changes and automatic deploy to server.

Table of Contents

About The Project

Have you tired of SSH to your server and run deployment command?
Did you make a small project and need test on the server quickly but you don't want to setup continuous integration?
Have you tired of managing SSH key?
Well, this thing might make it easy for you.

Getting Started

To get start you need to have some Docker knowledge.
If you want to modify this repository. you need JavaScript and Node.js.

Prerequisites

Installation

docker run -it -d \
	--name="github-autodeploy" \
	--restart="always" \
	-e GITHUB_USERNAME="" \
	-e GITHUB_KEY="" \
	-e GITHUB_REPOSITORY="wuttinanhi/test-compose" \
	-e GITHUB_BRANCH="test" \
	-e DEPLOY_DIRECTORY="//autodeploy-repo" \
	-e REFRESH_RATE=30000 \
	-v /var/run/docker.sock:/var/run/docker.sock \
	-v /autodeploy:/autodeploy-repo \
	wuttinanhi/autodeploy:latest

Available Environment Variable:

GITHUB_USERNAME (Optional)
Your GitHub username.

GITHUB_KEY (Optional)
Your GitHub Personal Access Token.
You can get it at https://github.com/settings/tokens repo scope are needed.

GITHUB_REPOSITORY (Required)
Repository to listening for change.
Example value: wuttinanhi/test-compose

GITHUB_BRANCH (Required)
Branch to listening for change.
Example value: test production

DEPLOY_DIRECTORY (Optional)
Directory path for store downloaded repository.
Default value: repo
Example value: //autodeploy-repo

REFRESH_RATE (Optional)
Wait for amount of milliseconds to see changes again.
Default value: 15000
Example value: 30000 (wait for 30 seconds) 60000 (wait 1 minute)

Volume:

(REQUIRED) Socket path are needed for contact docker daemon.

  • For Windows: -v //var/run/docker.sock:/var/run/docker.sock

  • For Linux: -v /var/run/docker.sock:/var/run/docker.sock


(Optional) Volume for store downloaded repository.
*Environment variable DEPLOY_DIRECTORY and mounted path need to be the same.
Example value:

  • Relative path:
    • -e DEPLOY_DIRECTORY=repo
    • -v /autodeploy:/nodejs/repo
  • Absolute path:
    • -e DEPLOY_DIRECTORY=//autodeploy-repo
    • -v /autodeploy:/autodeploy-repo

Known issues

  • Rate limiting
    if you encounter this issue you can solve this by authentication with GITHUB_USERNAME and GITHUB_KEY
    or change the amount of REFRESH_RATE.
    reference about this issue

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch
  3. Commit your Changes
  4. Push to the Branch
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

autodeploy's People

Contributors

wuttinanhi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.