CI/CD Pipeline Based on Jenkins – Workshop
Virtual Machine or Cloud Based Deployment
- We will be building a CI/CD Pipeline of a .net platform based application
Steps
- Jenkins Master and Node setup
- Node:
- os: ubuntu
- software:
- openjdk17 (jenkins)
- .net 7 sdk
- git
- zip
- Build steps:
git clone https://github.com/CICDProjects/nopCommerceJuly23.git
dotnet restore src/NopCommerce.sln
dotnet build -c Release src/NopCommerce.sln
dotnet publish -c Release src/Presentation/Nop.Web/Nop.Web.csproj -o publish
mkdir publish/bin publish/logs
zip -r nopCommerce.zip publish
- Now create a Jenkins file, in such a way that when a commit happens on develop branch the build creates a nopCommmerce zip file.
- solution Refer Here for the jenkins file
Container Based Deployment
Steps
-
Jenkins Master and Node setup
- Node:
- os: ubuntu
- software:
- Docker
- steps:
- curl -fsSL https://get.docker.com -o install-docker.sh
- sudo sh install-docker.sh
- sudo usermod -aG docker jenkins
- note: jenkins represents the user on the node
- restart jenkins server
-
build steps
git clone https://github.com/CICDProjects/nopCommerceJuly23.git
# replace latest with Git Commit id or build id
docker image build -t nopCommerce:latest .
#docker image tag nopCommmerce:latest shaikkhajaibrahim/nopCommerce:latest
#docker image push shaikkhajaibrahim/nopCommerce:latest
- Write Jenkinsfile for the above steps
Like this:
Like Loading...