a docker image listening for commit changes and automatic deploy to server.
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.
To get start you need to have some Docker knowledge.
If you want to modify this repository. you need JavaScript and Node.js.
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
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)
(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
- Rate limiting
if you encounter this issue you can solve this by authentication withGITHUB_USERNAME
andGITHUB_KEY
or change the amount ofREFRESH_RATE
.
reference about this issue
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.
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.