# branch protection rules

Branch protection rules are repository rules that protect branches by controlling interactions such as who can push commits and what requirements must be met before merging.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Setting Up CI / CD with Jenkins, Blue Ocean, Github for a Rust Program

DevFeed: [Setting Up CI / CD with Jenkins, Blue Ocean, Github for a Rust Program](<https://devfeed.tech/articles/setting-up-ci-cd-with-jenkins-blue-ocean-github-for-a-rust-program-28137.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/cicd/2020/06/05/setting-up-ci-cd-with-jenkins-blue-ocean-github-for-a-rust-program.html>)

Author: Fuzzygroup

Published: 2020-06-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [CI/CD](<https://devfeed.tech/topics/cicd.md>), [Jenkins](<https://devfeed.tech/topics/jenkins.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [Git](<https://devfeed.tech/topics/git.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>), [branch protection rules](<https://devfeed.tech/topics/branch-protection-rules.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>), [Ansible](<https://devfeed.tech/topics/ansible.md>)

Tags: [ansible](<https://devfeed.tech/tags/ansible.md>), [blue-ocean](<https://devfeed.tech/tags/blue-ocean.md>), [branch-protection-rules](<https://devfeed.tech/tags/branch-protection-rules.md>), [cd](<https://devfeed.tech/tags/cd.md>), [ci](<https://devfeed.tech/tags/ci.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [cicd](<https://devfeed.tech/tags/cicd.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [git](<https://devfeed.tech/tags/git.md>), [github](<https://devfeed.tech/tags/github.md>), [jenkins](<https://devfeed.tech/tags/jenkins.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [rust](<https://devfeed.tech/tags/rust.md>)

### AI overview

A tutorial for setting up CI/CD for a Rust codebase with Jenkins and the Blue Ocean plugin. It covers a Git workflow using feature, develop, and master branches, GitHub branch protection and pull requests, Jenkins deployment behind Nginx, and adding a Jenkinsfile.

### Source excerpt

CI / CD or "Continuous Integration / Continuous Deployment" is the process of: taking a source code base running tests against it compiling it (if applicable) deploying it CI / CD is an ongoing process that runs continuously and responds to pull requests on your source code repo. In this blog post we are going to: Take a git repo with a Rust code base Run it thru CI / CD using Jenkins with the Blue Ocean plugin Compile it Deploy it I'm not using Circle CI or another hosted CI / CD system as our overall deploy strategy is complex and Ansible based. Step 1: Correct Git Work Flow The git workflow we are using is: master branch develop branch feature branch All work happens in feature branches. Feature branches are then merged into develop and develop is merged into master. The goal here is that the master branch is always kept pristine. This means that you need to make some change to your github settings: Github Settings / Branches / Default branch - needs to be set to develop Github Settings / Branches / Branch protection rules - develop needs to be protected Here's what you need to do: Create a git repo. Push the code base to it. Create a develop branch in the code base. Change into that branch. Push that branch also. Go to settings for the repo. Click on branches. Set develop as the default branch. Click on branch protection rules. Add develop as a protected branch. This will turn on require pull requests before merging and you can set the number of people who have to approve pull requests before the merge. Add master as a protected branch. For this one you don't want pull requests on; you just want master protected. Step 2: Test the Git Work Flow Now you want to go into your repo and: Create a feature branch, call it "readme", and create / update the readme for the repo. Then you want to push the branch Then you want to follow the pull request url on the branch and submit it by clicking Create Pull Request Step 3: Get Jenkins Setup Traditionally with Blue Ocean Set