Followers

GitLab-Runner and CICD Pipe line

Install Gitlab Runner on Ubuntu 1. GoTo https://docs.gitlab.com/runner/install/linux-repository.html 2. curl -L "https://packages.gitla...

Install Gitlab Runner on Ubuntu


1. GoTo https://docs.gitlab.com/runner/install/linux-repository.html

2. curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash

3. sudo apt-get install gitlab-runner

4. apt-cache madison gitlab-runner


Register GitLab Runner


1. Create a GitLab Repository java-maven

2. Goto Setting ---> CICD-->Runner ---> Copy URL and Token

3. sudo gitlab-runner register

   Enter URL 

   ENTER Token

   ENTER Description :- gitlab-runner

   Enter Tag :- gitlab-runner

   Enter Executor :- shell

4. gitlab-runner -version

5. Add SSH keys using ssh-keygen 


Add Below CI/CD Pipeline

Example -1

demo_job_1:
  tags:
    - gitlab-runner
  script:
    - echo "Hello World"

Example 2

stages:          # List of stages for jobs, and their order of execution
  - build
  - test
  - deploy

build-job:       # This job runs in the build stage, which runs first.
  stage: build
  tags:
    - gitlab-runner
  script:
    - echo "Compiling the code..."
    - echo "Compile complete."
    - cd /home/ubuntu/java-maven
    - mvn package

unit-test-job:   # This job runs in the test stage.
  stage: test    # It only starts when the job in the build stage completes successfully.
  script:
    - echo "Running unit tests... This will take about 60 seconds."
    - sleep 60
    - echo "Code coverage is 90%"

lint-test-job:   # This job also runs in the test stage.
  stage: test    # It can run at the same time as unit-test-job (in parallel).
  script:
    - echo "Linting code... This will take about 10 seconds."
    - sleep 10
    - echo "No lint issues found."

deploy-job:      # This job runs in the deploy stage.
  stage: deploy  # It only runs when *both* jobs in the test stage complete successfully.
  script:
    - echo "Deploying application..."
    - echo "Application successfully deployed."


 

COMMENTS

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
ltr
item
DevOpsWorld: GitLab-Runner and CICD Pipe line
GitLab-Runner and CICD Pipe line
DevOpsWorld
https://www.devopsworld.co.in/2022/01/gitlab-runner-and-cicd-pipe-line.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/2022/01/gitlab-runner-and-cicd-pipe-line.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content