目標(biāo):構(gòu)建完整的持續(xù)集成環(huán)境,同時關(guān)聯(lián)SonarQube代碼檢測福贞,Git自動觸發(fā)機(jī)制
docker-compose.yml
jenkis:
image: jenkins/jenkins
networks:
- sonarnet
user: root
environment:
- JENKINS_USER=root
ports:
- 8080:8080
- 50000:50000
volumes:
- ./jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- /usr/local/bin/docker:/usr/bin/docker
restart: always
volumns:
- 本地docker路徑:/usr/bin/docker
- 本地docker運(yùn)行socket文件:/var/run/docker.sock
添加jenkins用戶到Docker用戶組
echo "docker:x:${dockerGid}:jenkins" >> /etc/group
初始化Jenkins
- copy 初始化生成的jenkins密碼,登錄jenkins
- 系統(tǒng)管理安裝自選插件:
Git Parameter
Publish Over SSH
Git
SonarQube
Ansible
參考集合