简体   繁体   中英

Jenkins workspace and git repository

when Jenkins is setup with GitHub repository, on building the job manually , does Jenkins downloads everything from the repository into the local system or only the latest changed files that were committed on GitHub ? Also if I wish to pull specific file to my local workspace on Jenkins what SCM configurations I should specify ?

When you queue a build for code from github by jenkins, jenkins will downloads the whole git repo from github, but it only build changes for the latest version/commit you specified.

If you want to build your local file by jenkins, you should commit the changes in local workspace (also it's the local git repo for github), and then push it to github, then queue a build or use CI build in Jenkins. detail steps to commit and push local change to github as below:

# In local git repo (parent folder is workspace)
# Assume your queue build for master in jenkins
git checkout master
# Add your local file in git repo
git add filename
git commit -m 'add local file'
git push

Then queue build in jenkins again, you will get the build result for your local file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM