Monday, December 16, 2019

AWS ElasticSearch ?

What is AWS ElasticSearch?


Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
Amazon Elasticsearch Service is a fully managed service that makes it easy for you to deploy, secure, and run Elasticsearch cost-effectively at scale

Elasticsearch Commands:
create indexes
curl -XPUT --header 'Content-Type: application/json' https://search-easyaws-wdxsl2qnhulmfbttlougfbgdj4.us-east-1.es.amazonaws.com/samples/_doc/1 -d '{ "name" : "easy"}'

list all indexes
curl -X GET 'https://search-esayaws-t4owdr3ym7zfiszspj6tdp526e.us-east-1.es.amazonaws.com/_cat/indices?v'

Query using URL parameters
curl -X GET https://search-esayaws-t4owdr3ym7zfiszspj6tdp526e.us-east-1.es.amazonaws.com/samples/_search?q=school:Harvard

list all docs in index
curl -X GET 'https://search-esayaws-t4owdr3ym7zfiszspj6tdp526e.us-east-1.es.amazonaws.com/sample/_search'

Health Check
curl  'https://search-esayaws-t4owdr3ym7zfiszspj6tdp526e.us-east-1.es.amazonaws.com/_cat/health?v'

Get Indexes
curl  'https://search-esayaws-t4owdr3ym7zfiszspj6tdp526e.us-east-1.es.amazonaws.com/_cat/indices?v'


delete index
curl -X DELETE 'https://search-esayaws-t4owdr3ym7zfiszspj6tdp526e.us-east-1.es.amazonaws.com/samples'


Tuesday, November 19, 2019

how to skip stage in jenkins pipeline


Skipped Stages in Jenkins Scripted Pipeline



To show all stages at every build even if not executed is a

good practice and brings transparency into pipelines

with conditional steps or stages. Add the when condition

to a stage of your pipeline:





pipeline {
    agent any
  stages {
    stage ('1 choice') {
      when {
                expression { choice == '1'}
            }
            steps {
                echo "Hello, Choice 1!"
            }
    }
    stage ('2 choice') {
      when {
                expression { choice == '2'}
            }
            steps {
                echo "Hello, Choice 2!"
            }
    }
  stage ('3 choice') {
      when {
                expression { choice == '3'}
            }
            steps {
                echo "Hello, Choice 3!"
            }
        }
  }
}







Top ChatGPT Prompts for DevOps Engineers

  As a DevOps engineer, your role involves juggling complex tasks such as automation, infrastructure management, CI/CD pipelines, and troubl...