Skip to content

Instantly share code, notes, and snippets.

🎯
Pragmatic

Athavan Kanapuli kanapuli

🎯
Pragmatic
Block or report user

Report or block kanapuli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kanapuli
kanapuli / Jenkinsfile
Created Dec 2, 2019 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage c…
View Jenkinsfile
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8-alpine
@kanapuli
kanapuli / Jenkinsfile
Created Sep 3, 2019
Jenkinsfile Format
View Jenkinsfile
@Library('github.com/triologygmbh/jenkinsfile@ad12c8a9') _
pipeline {
agent { label 'docker' } // Require a build executor with docker
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10'))
}
View gist:4e919ca08d64dff8d6b606341844228c
# This tells kubecfg to read its config from the local directory
export KUBECONFIG=./kubeconfig
# Looking at the cluster
kubectl get nodes
kubectl get pods --namespace=kube-system
# Running a single pod
kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard
kubectl get pods
@kanapuli
kanapuli / find-old-branches.sh
Created Jul 12, 2019 — forked from mroderick/find-old-branches.sh
A small script to find stale branches
View find-old-branches.sh
#!/bin/bash
# This is a very naive script, it doesn't do grouping and returns all branches
# I only really care about branches that have not seen commits in two months
#
# I am hoping to find some time to write a tool that can output these reports for me
# In the meantime, I am using this
echo "Merged branches"
for branch in `git branch -r --merged | grep -v HEAD`;do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, " $branch | head -n 1` \\t$branch; done | sort -r
View bool.json
//AND operation syntax
{
"query":{
"bool":{
"must":[]
}
}
}
//OR operation syntax
View match.json
//match query retrieves all documents which has a title like 'Japan%'
{
"_source":["id","name"],
"query":{
"match":{
"title": "Japan"
}
}
}
View source.json
{
"_source":["id","name"],
"query":{
"match_all":{}
}
}
View order.json
//sort query sorts the document based on the field specified
{
"query": {
"match_all": {},
"sort": [
{
"id": {
"order": "desc"
}
},
View match_all between.json
//This brings the record from 100th document and gets the next 100 document
{
"query": {
"match_all": {},
"from": 100,
"size": 100
}
}
View match_all size.json
//size retrieves only 10 documents back
{
"size": 10,
"query": {
"match_all": {}
}
}
You can’t perform that action at this time.