Pull your project git code into a data volume and trigger event via Webhook.
2.7K
Pull your project git code into a data volume and trigger event via Webhook.
This image is based on Alpine Linux image, which is a 439MB image.
Download size of this image is:
Docker hub image: funnyzak/git-webhook
Docker Pull Command: docker pull funnyzak/git-webhook
Webhook Url: http://hostname:9000/hooks/git-webhook?token=HOOK_TOKEN
The 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.
StartUp|BeforePull|AfterPull|AfterPackageBeforePull|AfterPackagessh-keygen -t rsa -b 4096 -C "[email protected]" -N "" -f ./id_rsa
You can use notifications by call "/app/scripts/utils.sh" in the execution script.
source /app/scripts/utils.sh;
notify_all "hello world"
show package elapsed second.
docker exec servername cat /tmp/ELAPSED_TIME
show package elapsed time label.
docker exec servername cat /tmp/ELAPSED_TIME_LABEL
show git commit hash that currently deployed successfully.
docker exec servername cat /tmp/CURRENT_GIT_COMMIT_ID
version: '3'
services:
hookserver:
image: funnyzak/git-webhook
privileged: true
container_name: git-hook
working_dir: /app/code
logging:
driver: 'json-file'
options:
max-size: '1g'
tty: true
environment:
- TZ=Asia/Shanghai
- LANG=C.UTF-8
- USE_HOOK=1
- HOOK_TOKEN=hello
- GIT_REPO=https://github.com/vuejs/vuepress.git
- GIT_BRANCH=master
- GIT_EMAIL=youremail
- GIT_NAME=yourname
- STARTUP_COMMANDS=echo "STARTUP_COMMANDS helllo"
- AFTER_PULL_COMMANDS=echo "AFTER_PULL_COMMANDS hello"
- BEFORE_PULL_COMMANDS=echo "AFTER_PULL_COMMANDS”
- APP_NAME=myapp
- NOTIFY_ACTION_LABEL=已启动|源码拉取中..|源码已拉取最新,开始打包..|部署已完成
- NOTIFY_ACTION_LIST=StartUp|BeforePull|AfterPull|AfterPackage
- TELEGRAM_BOT_TOKEN=123456789:SDFW33-CbovPM2TeHFCiPUDTLy1uYmN04I###9865678987
- DINGTALK_TOKEN_LIST=dingtoken_one|dingtoken_two
- JISHIDA_TOKEN_LIST=jishida_token
restart: on-failure
ports:
- 1001:9000
volumes:
- ./custom_scripts:/custom_scripts
- ./code:/app/code
- ./ssh:/root/.ssh
Content type
Image
Digest
Size
685.4 MB
Last updated
almost 5 years ago
docker pull funnyzak/git-webhook