Circle CI Introduction

 CI/CD Continuous Integration/ Continuous Development or Deployment using Circle CI ☺☺




What is CI/CD ?

We know that every developer in a team will commit daily to a Version Control System(VCS) like GitHub or GitLab. So CI will trigger a set of events or processes like automated build, test and deployment that can occur after that commit has happened. 

Why ?

  • Improve team productivity, efficiency
  • Find problems and solve them quickly
  • Release higher quality and more stable products. 

Why Circle CI?
  • Jobs run fast 
  • Can run complex pipelines efficiently with sophisticated chaining, docker layer chaining, resource classes for running on faster machines. 
  • Free to use 
  • Easy to use with dashboards 
  • Integrated with Github and Bitbucket 
  • Troubleshoot problems using ssh into a job to inspect log files, processes etc. 

So what are steps: 

  • I commit through VCS
  • It works through of the CI/CD pipeline like (build, analysis, Unit test)
  • Finally all the pipeline process are ok and we are good to go. 
To set up all this pipeline process we need to create a config.yml file 

Prerequisites:

  1. Project 
  2. Commit the project in VCS 

Use case: 

  • Navigate to https://circleci.com/
  • Sign up with Github 
  • Setup your project 
  • Create a new folder circleci > add your config.yml file. 
  • Steps are those pipelines (donuts) that it has to go through. 
  • Commit with SVN 
  • Run the Build with Circle CI 

SAMPLE EXAMPLE OF CONFIG.YML FILE IN GRADLE(JAVA)

version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-29
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Build in Debug
command: ./gradlew buildDebug
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run Tests in Debug
command: ./gradlew testDebug
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results


Comments

Popular Posts