CI/CD with Jenkins [closed] - jenkins

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 days ago.
Improve this question
I just started to learn CI/CD with Jenkins.
Currently, I am very confused about the process with CI, and I'm not sure my understanding is correct or not.
Below is my understanding:
Coding in my local -> push the changes to GitHub with git -> pull the code from Github and build project with Jenkins
My other question is, is it every time I need to click build now in Jenkins manually, or it will automate build again after I make a change?

For the first question you need to integrate Jenkins with build tools like Ant in the CI/CD pipeline to build the code after pull the code from Github.
For the second question gothrough the link automate the build it may helpful.

Your understanding is correct and also, you can have Unit Testing stage before build project.
To build a project using Jenkins, you need not have to run the Jenkins pipeline manually everytime. You can make use of Webhooks in Github to automatically trigger the Jenkins pipeline on every commit or push or various other scenarios.
Here is the guide to help you understand more:
https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks
A simple tutorial on webhooks: https://www.blazemeter.com/blog/how-to-integrate-your-github-repository-to-your-jenkins-project
Some other ways:
You can also make use of the options available in Build Trigger sections which is available in your pipeline settings to build the Jenkins pipeline automatically.
Options:
Trigger builds remotely (e.g., from scripts)
Build after other projects are built
Build periodically
Build when a change is pushed to GitLab. GitLab webhook URL: https://<github_url> (Webhook)
GitHub hook trigger for GITScm polling
Poll SCM

Related

GitHub action Manual approval process

I know that GitHub Action manual triggers is a very discussed issue, manual approval is a bit less discussed but still present in the community.
I have a question for those who use Github actions for CD purposes.
As you know Bitbucket, Gitlab, Azure Devops etc. have a feature Manual approval which means that a pipeline can reach a certain step in the process for example: build -> test -> deploy to staging.
The next step is deploy to production yet it needs a manual approval or trigger. So my question is this, were any of you achieve that functionality in GitHub action with the same information (branch name, same test results) without running the whole pipeline again? (It's kind of the reason why I am not migrating us from Bitbucket to GitHub yet)
Thank you for your answers
Recently, the GitHub team has announced Environments in beta. With this feature, you can add Manual approvals into your CI/CD.
Environment workflow syntax
However, there is a restriction for private repositories - Only GitHub Enterprise service plan can use Environments within private repositories.
So in GitHub there are two ways to do manual approval for deployments .
Using Environments
Using GitHub action

What is the best practice for CI development?

We are starting to develop CI workflow for our systems in my company.
Currently we just making few basic tasks like build, tests, and upload to Nexus.
The tech stack is a Java project which build in Gradle and Jenkins makes our build.
Currently i'm working with some basic Groovy script to make what we need, but each time i'm copy and paste my updated code to Jenkins and running the job from Jenkins UI to see the results, and to me it seems like not a very good approach for developing such automation code.
My question is, what is the best practice to build and run Jenkins jobs?
Is it possible to run it straight from Intellij ?
Do we need to create a Jenkins project which should be saved as a repository and then deploy it to Jenkins machine?
Do we need to use some Intellij plugins in order to work with Jenkins?
More best practices are welcome :)
Jenkins has an API - so you can do whatever you want!
But in general, for small to medium teams it's better to use Jenkinsfile and let Jenkins pull code changes (or pull-requests) from SCM and trigger builds. You can also configure hooks to trigger builds if your SCM supports this (Github & bitbucket supports this).
If you are eventually pushing your artifacts to a docker image, I would highly recommend docker multi-stage builds.
If you are completely new to CI/CD stuff - Atlassian has a lot of good resources https://www.atlassian.com/continuous-delivery/principles/continuous-integration-vs-delivery-vs-deployment

Continual integration, delivery and deployment of a Springboot Application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have an assignment to continually integrate, deliver and deploy a Springboot application with Angular using: Gitlab CI, Docker, Kubernetes, Jenkins and SonarQube. My assignment name was as the question is titled with using the technologies described. Any help would be much appreciated. I've already searched the web and learned about these technologies. My question is: How and where to start, which steps should i define so I could complete my assignment? Any help would be much appreciated
Make a repo in gitlab with branches test and prod
Setup docker image build pipeline ( for both the branches ) that will build/test the code and package it in docker image using multi state build ( gitlab CI)
Configure a webhook that triggers a deployment to test environment ( either in jenkins or gitlabci)
Configure a downstream job that can be run manally to deploy to production ( in jenkins or gitlab CI)
In both the deploymenet steps above you will need the declatrivate deployment manifests for kubernetes
The above are just basics , there are many other tools that can be used for kubernetes deployments.
The usual approch is to commit code to testing/dev and then build/test the docker image and triger test deployment as soon as the image is arrived in registry. if everything goes well , then you just port the change to prod branch that will trigger the pipeline again for building/testing the prod image followed by deployment.

CICD with jenkins and sonarqube

from the last week i am working with jenkins, and its going good but at the end of R&D I have lost of confusion, these are questions which confusingto me.
How to do Continuous Integration with jenkins of Website?
hoe to view Testing analysis reports produced by sonarqube server to my local system?
what happens where all my developers will do commit and push at the same time on repository?
How to deploy my web application on targeted server using jenkins?
How to I use sonarqube to test my website ?
If you are building a .net website, install msbuild plugin in jenkins. Create a jenkins job, add a step checkout your website (git/svn - install required repo plugin). Schedule to run nightly or hourly depending on your needs.
Type in url for your sonarqube server and then you can view the reports.
This is not an issue if your developers are comitting simultaneously. Usually a CI tool such as Jenkins will take care of that.
This is called continuous deployment or continuous delivery. Something like Octopus Deploy can help you if you are deploying .net applications. You can use the tool octo.exe and pass the API key as parameter to deploy to a specific environment.
SonarQube is used as a quality gate for code analysis. It is not a test framework. Try to investigate on how to use selenium framework for automation testing.
I hope that I have answered your questions.

How do travis-ci and gitlab-ci compare? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
As far as I understand, the main difference is that gitlab-ci is opensource (you can install it on your own server) and travis-ci isn't.
So then the latter is always cloud/service-based. And it's free for open source projects.
But then GitLab.com (the company, not the software) also has a cloud version that you don't need to install: ci.gitlab.com. And I'm guessing this version can only be used with public repositories posted in your Gitlab account.
But then, there's almost no documentation out there about running GitLab CI this way. Most of the docs I find are about installing the GitLab CI server or the runners. But how are the ci.gitlab.com's runners configured? What OS do they have? Can I have Windows/Mac runners? (The software supports these OSs apparently, but it's not specified what runners are supplied by ci.gitlab.com's service.)
Edit: 29/06/2016
As comments suggest, now gitlab is offering what they call shared runners. This means that you no longer need to bring your own runner, you can use theirs instead and use it just like travis CI, but there is a limit of 2,000 minutes of CI run-time per month for the free tier.
** Previous historic answer **
Gitlab CI can be used online, but you must bring your own runners. What does this means? You need to install a piece of software in your servers which will run the tests. Its more complex than travis.
After installing you have to associate it with your project, and configure it if you want to run tests inside docker or in your bare hardware. There are few more options.
Each time you push a commit to gitlab, a hook is triggered to gitlab ci and a build is sent to an available runner which executes the build and tests and send back tests results to gitlab ci server.
Now, with the last update, gitlab ci is inside gitlab, but it is still the same.

Resources