gitea 使用jenkins 自動(dòng)ci
簡(jiǎn)介
我目前使用的代碼倉庫是使用 gitea
搭建而成的,詳細參見(jiàn)https://git.zeekling.cn, 最近在看redis源碼于是就想著(zhù)加個(gè)自動(dòng)ci的東西。
安裝jenkins
執行下面腳本安裝jenkins
docker pull jenkins/jenkins
docker stop jenkins
docker rm jenkins
docker run -d -t \
-p 8888:8080 \
-p 50000:50000 \
-v /dockerData/jenkins/:/var/jenkins \
--name=jenkins \
jenkins/jenkins
安裝gitea插件
到網(wǎng)站https://plugins.jenkins.io/gitea/中下載gitea插件。如下圖所示上傳gitea插件:
配置gitea
在gitea應用下面新增Tokens
在Manager->Configure System 下面新增gitea token信息
新建jenkins ci
在所需要ci的項目里面新增文件Jenkinsfile,寫(xiě)入編譯腳本
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'bash build.sh'
}
}
}
}
選擇新增items,選擇Gitea Organization,并且選擇自己添加的gitea條目。
安裝插件
安裝c語(yǔ)言相關(guān)的包:
docker cp /etc/apt/sources.list jenkins:/etc/apt/sources.list
docker exec -it -u root jenkins /bin/bash
apt install libjemalloc-dev libjemalloc1
apt install autoconf automake libtool make
結果展示
結果如下:
提交完之后可以選是編譯通過(guò):

0 評論