1、克隆代码到本地
git clone https://gitlab.zhoumx.net/root/gitlab-webhook-dingrobot.git
配置钉钉webhook
cd ./gitlab-webhook-dingrobot/src/main/resources
vim application.yml
server:
port: 8787
webhook:
enable-emoji: true
way: ding
ding:
access-token: ddd93187885d9884 # 填写access_token即可
sign-key: ddd81dbfeff3
gitlab:
enable: true
host: https://xx.com
private-token: ddd # gitlab项目下新建访问令牌
spring:
application:
name: @artifactId@
banner:
location: banner.txt
2、配置依赖
yum install -y java maven docker-ce
3、构建JAR包
cd ./gitlab-webhook-dingrobot
mvn package -B -Dmaven.test.skip=true
4、部署至Docker
配置根目录下的Dockerfile文件
vim Dockerfile
FROM openjdk:8-jre-alpine
VOLUME /tmp
ADD target/gitlab-webhook-robot-1.0.jar app.jar
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENTRYPOINT ["java","-Xmx256m","-Xms256m","-Xss512k","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
构建镜像
docker build -f Dockerfile -t gitlab-webhook-dingrobot .
启动容器
docker run -d -m 512m --network=host --restart=always -v /opt/logs/:/opt/logs -v /etc/localtime:/etc/localtime gitlab-webhook-dingrobot --spring.profiles.active=dev
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。