{"id":16098600,"url":"https://github.com/funnyzak/git-job-docker","last_synced_at":"2026-02-19T06:31:04.360Z","repository":{"id":114592635,"uuid":"507889975","full_name":"funnyzak/git-job-docker","owner":"funnyzak","description":"Trigger a source code pull with a push event from the git webhook. And then execute the commands.","archived":false,"fork":false,"pushed_at":"2024-10-31T11:42:29.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T02:44:50.069Z","etag":null,"topics":["docker","docker-compose","dockerfile","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funnyzak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-27T11:57:59.000Z","updated_at":"2024-10-31T11:42:08.000Z","dependencies_parsed_at":"2023-12-26T05:31:06.161Z","dependency_job_id":"2ddfa0f4-26a2-475f-b948-6ee7375e90e4","html_url":"https://github.com/funnyzak/git-job-docker","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/funnyzak/git-job-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-job-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-job-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-job-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-job-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funnyzak","download_url":"https://codeload.github.com/funnyzak/git-job-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-job-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29604768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T05:11:50.834Z","status":"ssl_error","status_checked_at":"2026-02-19T05:11:38.921Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","dockerfile","shell"],"created_at":"2024-10-09T18:24:07.586Z","updated_at":"2026-02-19T06:31:04.339Z","avatar_url":"https://github.com/funnyzak.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Job Docker\n\n[![Build Status][build-status-image]][build-status]\n[![Docker Stars][docker-star-image]][docker-hub-url]\n[![Docker Pulls][docker-pull-image]][docker-hub-url]\n[![GitHub release (latest by date)][latest-release]][repository-url]\n[![GitHub][license-image]][repository-url]\n\nTrigger a source code pull with a push event from the git webhook. And then execute the commands. Base Image: [funnyzak/java-nodejs-python-go-etc-docker](https://github.com/funnyzak/java-nodejs-python-go-etc-docker).\n\nDownload size of this image is:\n\n[![Image Size][docker-image-size]][docker-hub-url]\n\n[Docker hub image: funnyzak/git-job][docker-hub-url]\n\n**Docker Pull Command**: `docker pull funnyzak/git-job:latest`\n\nChina mirror: `docker pull registry.cn-beijing.aliyuncs.com/funnyzak/git-job:latest`\n\nThe nginx service is enabled by default, and the proxy ports are 80 and 9000, default webhook event is `push`. And the webhook url path is `/hooks/git-webhook`, url parameter is `token`. For example:\n\n- `http://hostname:80/hooks/git-webhook?token=HOOK_TOKEN`\n- `http://hostname:9000/hooks/git-webhook?token=HOOK_TOKEN`\n\n**Attention:** Current version is not compatible old version, please use tag `1.1.0` if you want to use old version.\n\n## Environment\n\nThe following environment variables are used to configure the container:\n\n### Required\n\nThe following flags are a list of all the currently supported options that can be changed by passing in the variables to docker with the -e flag.\n\n- `GIT_USER_EMAIL` - The email of the git committer. Required.\n- `GIT_REPO_URL` - The remote url of the git repository. Required. Example: `git@github.com:funnyzak/vp-starter.git`.\n- `HOOK_TOKEN` - The token of the webhook. Required.\n\n### Optional\n\nThe following environment variables are optional:\n\n- `USE_HOOK` - Set to `true` to enable the webhook. Default is `true`.\n- `GIT_USER_NAME` - The username of the git. Optional.\n- `GIT_BRANCH` - The branch of the git repository to pull. Optional. Default is the repo main branch.\n- `STARTUP_COMMANDS` - Optional. A shell command that will be run at the end of the start shell script. left blank, will not execute.\n- `BEFORE_PULL_COMMANDS` - Optional. A shell command that will be run before pull code. left blank, will not execute.\n- `AFTER_PULL_COMMANDS` - Optional. A shell command that will be run after pull code. left blank, will not execute.\n- `CODE_DIR` - The code dir of the git repository. Optional. Default is `/app/code`.\n- `TARGET_DIR` - If after pull code, you want to execute build action, you can set the target dir. Optional. Default is `/app/target`.\n- `INSTALL_DEPS_COMMAND` - If after pull code, you want to execute install dependencies action, you can set the install command. Optional. For example: `npm install`.\n- `BUILD_COMMAND` - If after install deps, you want to execute build action, you can set the build command. Optional. For example: `npm run build`.\n- `BUILD_OUTPUT_DIR` - Set the build output dir. Optional. It is relative to `CODE_DIR`. For example: `dist`. Build output dir will rsync to `TARGET_DIR`.\n- `AFTER_BUILD_COMMANDS` - If after build, you want to execute other action, you can set the commands. Optional. For example: `npm run deploy`.\n\n### Pushoo\n\nIf you want to receive message with pushoo, you need to set `PUSHOO_PUSH_PLATFORMS` and `PUSHOO_PUSH_TOKENS`.\n\n- `SERVER_NAME` - The server name, used for pushoo message. Optional.\n- `PUSHOO_PUSH_PLATFORMS` - The push platforms, separated by commas. Optional.\n- `PUSHOO_PUSH_TOKENS` - The push tokens, separated by commas. Optional.\n- `PUSH_MESSAGE_HEAD` - The push message head. Optional. Default is empty.\n- `PUSH_MESSGE_FOOT` - The push message foot. Optional. Default is empty.\n\nFor more details, please refer to [pushoo-cli](https://github.com/funnyzak/pushoo-cli).\n\n## Volume\n\n- `/app/code` - Git code folder. Must same as `CODE_DIR`. For example: `./code:/app/code`.\n- `/root/.ssh` - Git ssh key folder. For example: `./ssh:/root/.ssh`.\n- `/app/target` - The target of the code build. Must same as `TARGET_DIR`. For example: `./target:/app/target`.\n- `/app/scripts` - The main scripts folder. contains `hook.sh`, `utils.sh`, `entrypoint.sh`.\n- `/custom_scripts/on_startup` - which the scripts are executed at startup. For example: `./scripts/on_startup:/custom_scripts/on_startup`.\n- `/custom_scripts/before_pull` - which the scripts are executed at before pull. Same as `/custom_scripts/on_startup`.\n- `/custom_scripts/after_pull` - which the scripts are executed at after pull. Same as `/custom_scripts/on_startup`.\n\n## Usage\n\n### Command\n\nFollow the example below to use docker to start the container, you should acdjust the environment variables according to your needs.\n\n```bash\ndocker run -d -t -i --name git-job --restart on-failure:5 --privileged=true \\\n-e TZ=Asia/Shanghai \\\n-e LANG=C.UTF-8 \\\n-e USE_HOOK=true \\\n-e GIT_USER_NAME=Leon \\\n-e GIT_USER_EMAIL=silenceace@gmail.com \\\n-e GIT_REPO_URL=git@github.com:funnyzak/git-job.git \\\n-p 81:80 funnyzak/git-job\n```\n\n### Compose\n\n#### Full configuration\n\nFollow the example below to use docker-compose to start the container, and the environment variables are fully configured.\n\n ```yaml\nversion: '3'\nservices:\n  app:\n    image: funnyzak/git-job\n    privileged: false\n    container_name: gitjob\n    working_dir: /app/code\n    tty: true\n    environment:\n      - TZ=Asia/Shanghai\n      - LANG=C.UTF-8\n      # repo config\n      - USE_HOOK=true\n      - GIT_USER_NAME=Leon\n      - GIT_USER_EMAIL=silenceace@gmail.com\n      - HOOK_TOKEN=XqMWRndVuxXQDNzbE9Z\n      - GIT_REPO_URL=git@github.com:funnyzak/git-job.git\n      - GIT_BRANCH=main\n      # commands\n      - STARTUP_COMMANDS=echo start time:$$(date)\n      - BEFORE_PULL_COMMANDS=echo before pull time:$$(date)\n      - AFTER_PULL_COMMANDS=echo after pull time:$$(date)\n      # pushoo \n      - SERVER_NAME=demo server\n      - PUSHOO_PUSH_PLATFORMS=dingtalk,bark\n      - PUSHOO_PUSH_TOKENS=dingtalktoken:barktoken\n      - PUSHOO_PUSH_OPTIONS={\"dingtalk\":{\"atMobiles\":[\"13800000000\"]},\"bark\":{\"sound\":\"tink\"}}\n      - PUSH_MESSAGE_HEAD=This is a message head\n      - PUSH_MESSAGE_FOOT=## Other\n\n          * Click Here：[Home Page](https://www.domain.com/)\n      # custom environment for build\n      - INSTALL_DEPS_COMMAND=echo install deps time:$$(date)\n      - BUILD_COMMAND=mkdir target \u0026\u0026 zip -r ./target/release.zip ./*\n      - BUILD_OUTPUT_DIR=./dist\n      - AFTER_BUILD_COMMANDS=echo after build time:$$(date)\n      # custom environment for aliyun oss\n      - ALIYUN_OSS_ENDPOINT=oss-cn-beijing-internal.aliyuncs.com\n      - ALIYUN_OSS_AK_ID=123456789\n      - ALIYUN_OSS_AK_SID=sxgh645etrdgfjh4635wer\n      # optional\n      - CODE_DIR=/app/code\n      - TARGET_DIR=/app/target\n    restart: on-failure\n    ports:\n      - 1038:80\n    volumes:\n      - ./target:/app/target\n      - ./ssh:/root/.ssh\n      - ./scripts/after_pull/after_pull_build_app.sh:/custom_scripts/after_pull/3.sh\n\n ```\n\n#### Simple configuration\n\nFollow the example below to use docker-compose to start the container, and the environment variables are not fully configured.\n\n ```yaml\nversion: '3'\nservices:\n  app:\n    image: funnyzak/git-job\n    privileged: false\n    container_name: gitjob\n    tty: true\n    environment:\n      - GIT_USER_NAME=Leon\n      - GIT_USER_EMAIL=silenceace@gmail.com\n      - HOOK_TOKEN=XqMWRndVuxXQDNzbE9Z\n      - GIT_REPO_URL=git@github.com:funnyzak/git-job.git\n      - GIT_BRANCH=main\n      # pushoo \n      - SERVER_NAME=demo server\n      - PUSHOO_PUSH_PLATFORMS=dingtalk,bark\n      - PUSHOO_PUSH_TOKENS=dingtalk:xxxx,bark:xxxx\n      # custom environment for build\n      - INSTALL_DEPS_COMMAND=echo install deps time:$$(date)\n      - BUILD_COMMAND=mkdir target \u0026\u0026 zip -r ./target/release.zip ./*\n      - BUILD_OUTPUT_DIR=./dist\n    restart: on-failure\n    ports:\n      - 1038:80\n    volumes:\n      - ./target:/app/target\n      - ./ssh:/root/.ssh\n      - ./scripts/after_pull/after_pull_build_app.sh:/custom_scripts/after_pull/3.sh\n ```\n\n## Other\n\n### SSH Key\n\nIf you want to use ssh-key, you need to mount the ssh-key folder to `/root/.ssh`. Generally, you need to mount the `id_rsa` and `id_rsa.pub` files. For example:\n\n ```yaml\nvolumes:\n  - ./ssh:/root/.ssh\n ```\n\n Your can use `ssh-keygen` to generate the ssh-key.For example:\n\n ```bash\nssh-keygen -t rsa -b 4096 -C \"youremail@gmail.com\" -N \"\" -f ./id_rsa\n```\n\n## Modules\n\nThe following modules are installed in the image.\n\n### Base Module\n\n- **nginx** 1.22\n- **git** 2.30.2\n- **curl** 7.74.0\n- **wget** 1.21\n- **nrm** 1.2.5\n- **ossutil64** 1.7.14\n- **ttf-mscorefonts**\n- **go** 1.20\n- **java** 1.8.0_292\n- **mvn** 3.3.9\n- **python** 3.9.2\n- **node** 16.19.0\n- **npm** 8.19.3\n- **yarn** 1.22.19\n- **certbot**\n- **n** 8.2.0\n- **tar** 1.34\n- **zip** 10.2.1\n- **bash** 5.1.4\n- **rsync** 3.2.3\n- **gzip** 1.10\n- **bzip2** 1.0.8\n- **openssl** 1.1.1n\n- **tree** 1.8.0\n- **crontab** 1.5.2\n- **rclone** 1.53.3\n- **mysql-client** 10.19\n- **[webhook 2.8.0](https://github.com/adnanh/webhook)**\n\n### Other\n\n- **tzdata**\n- **gcc**\n- **g++**\n- **[pushoo-cli](https://github.com/funnyzak/pushoo-cli)**\n\nMore details, please refer to [funnyzak/java-nodejs-python-go-etc-docker](https://github.com/funnyzak/java-nodejs-python-go-etc-docker).\n\n## Contribution\n\nIf you have any questions or suggestions, please feel free to submit an issue or pull request.\n\n\u003ca href=\"https://github.com/funnyzak/git-job-docker/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=funnyzak/git-job-docker\" /\u003e\n\u003c/a\u003e\n\n## License\n\nMIT License © 2022 [funnyzak](https://github.com/funnyzak)\n\n[build-status-image]: https://github.com/funnyzak/git-job-docker/actions/workflows/build.yml/badge.svg\n[build-status]: https://github.com/funnyzak/git-job-docker/actions\n[repository-url]: https://github.com/funnyzak/git-job-docker\n[license-image]: https://img.shields.io/github/license/funnyzak/git-job-docker?style=flat-square\u0026logo=github\u0026logoColor=white\u0026label=license\n[latest-release]: https://img.shields.io/github/v/release/funnyzak/git-job-docker\n[docker-star-image]: https://img.shields.io/docker/stars/funnyzak/git-job.svg?style=flat-square\n[docker-pull-image]: https://img.shields.io/docker/pulls/funnyzak/git-job.svg?style=flat-square\n[docker-image-size]: https://img.shields.io/docker/image-size/funnyzak/git-job\n[docker-hub-url]: https://hub.docker.com/r/funnyzak/git-job\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Fgit-job-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunnyzak%2Fgit-job-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Fgit-job-docker/lists"}