Easiest way to deploy automatic builds over remote server
In this blog, I will write down the details about how to deploy code to a remote server using Continuous Integration pipeline with GitLab repository and Jenkins as an automation tool for CI/CD.
Step 1: click on New Item from Jenkins Dashboard
Step 2: Create Free style project
Enter an item name (ex: demo)
And choose Freestyle Project
Step 3:
Click on "Ok", at the end of that page while scrolling down.
Step4:
Now configure the job
-->Give some general description of the job.
-->Discard old builds to keep you Jenkins server light weighted.
-->Select default Strategy Log Rotation
-->Can select Days to keep builds or Max # of builds to keep as per requirement.
-->Now create a GitLab Connection
Following are the process to create GitLab connection.
i) Create a developer account in GitLab and generate access token under user settings.
ii) Prerequisite for this step is few plugins needed to be installed as below In Jenkins
iii) Using the access token gitlab connection needs to be set up.
Step 5: Source Code Management
Choose Git repository and input Repository URL in given box
Credentials to the gitlab repository access should be created in jenkins credentials beforehand.
Specify the branch to build.
Mention Repository browser, select gitlab and insert URL and version.
Step 6: Build Triggers
Select Build when a change is pushed to GitLab. GitLab webhook URL: "JenkinsHostName:Port"/project/"projectname" and schedule Poll SCM which will trigger build for certain interval
Step 7: Build Environment
Select options whichever is necessary according to the need
Step 8 : Build
Set up certains post build actions such as archiving code artifacts. Files to be included can be set up here.
Step 8a: As the code should be deployed over remote server ssh needed to be integrated. In advance options if certain files needed to be excluded from build can be done.
For this step SSH servers should be set up in Jenkins configuration
That's all now workspace can be deleted once build is done to minimize jenkins server load as post build action and email notifications can be set up as per requirement.
Now the job can be saved.
Leave Easiest way to deploy automatic builds over remote server to:
Read more #devops posts
Best Posts From dips9
We have not curated any of dipanwita's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From dips9
- Easiest way to deploy automatic builds over remote server
- Demonetisation was the ‘largest money laundering scheme ever’, told Arun Shourie
- 8 Questions Every Citizen Should Ask Before Rallying For Rivers
- Ads don't work so websites are using your electricity to pay the bills
- Indian demonitisation scheme turned out to be a huge flop. But sushhhh.. Common people must not know that.
- A woman interviewed 100 convicted rapists in India. This is what she learned.
- Wayanad, Greenery overloaded.