Jenkins pipeline git pycharm 配置

                  

 

一 本地git 服務安裝配置

1. 在192.168.8.108 centos 7.3.1611 安裝git 軟件

yum -y install git 
useradd git
echo ‘qweasd’ | passwd –stdin git 
mkdir /git/reps -p && cd /git/reps
git init --bare jenkins_pipeline.git
chown -R git.git jenkins_pipeline.git
usermod -s /usr/bin/git-shell git


2. 客戶端192.168.8.106 機器進行clone 測試

git clone [email protected]:/git/reps/jenkins_pipeline.git  
# 可以新建一個文件進行測試
cd Jenkins_pipeline.git && echo ‘test file’ > aa.log
git add .  
git commit -m ‘註釋說明’    
git push -u origin master   # 一定要加上 -u origin master


 

二. 配置pycharm  編輯器進行編輯

首先右鍵file  => 選擇setting => 找到version control => git

pycharm  配置git2.png


 

點擊file => CloseProject 關閉這個項目,接着配置新項目

pycharm3.png

pycharm4.png

Clone 完代碼就能進行編寫 pipeline Jenkinsfile了。


三. Jenkins  配置pipeline 代碼

1. 在jenkins 中配置 git 認證

jenkins_git_認證.png

2. 配置jenkins pipeline 項目進行配置

jenkins2.png

這樣就可以在pycharm 中編寫pipeline 文件了。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章