Skip to content

Instantly share code, notes, and snippets.

@parjun8840
parjun8840 / gist:399d519449e25f0377944c32011dcde8
Created January 2, 2024 01:14
golden-image-gcp-packer.hcl
file provider.pkr.hcl
#########################
packer {
required_plugins {
googlecompute = {
source = "github.com/hashicorp/googlecompute"
version = "~> 1"
}
ansible = {
@parjun8840
parjun8840 / jenkins-pipeline-github-actions.txt
Created April 2, 2023 04:15
Jenkins Pipeline GitHub Actions
#Please create the required secrets
#Script path- jenkins-series/scripts/send_slack.sh
#!/bin/bash
set -e
usage() {
echo "usage: ${0##*/} -u <SLACK_URL> -t <TEXT> -w <GITHUB_WOFKFLOW>"
exit 1
}
send_slack() {
@parjun8840
parjun8840 / Github-Jenkins-Salck.txt
Last active April 2, 2023 03:24
Github configuration for slacknotifications
#######Get the Workflow id using GitHub API###############
% curl -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer XXXXXXXXXXXXXXXX"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/parjun8840/gha01/actions/workflows
{
"total_count": 10,
"workflows": [
{
@parjun8840
parjun8840 / scaling-eks-cluster.groovy
Last active April 3, 2023 12:59
Scaling EKS cluster
def roleArn = "arn:aws:iam:123467890:role/jenkins-iam"
def profile = "--profile devops"
//In Terraform I prefer using argumnet "ignore_changes" inside "lifecycle" block for the NodeGroup
//and manage the Nodes count independentely to control the cost & easy operations
pipeline{
agent {
kubernetes {
yaml '''
apiVersion: v1
@parjun8840
parjun8840 / commonWorkflow.groovy
Created March 28, 2023 23:16
commonWorkflow.groovy
def call(String repoUrl) {
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
@parjun8840
parjun8840 / pipeline-jobdsl-github
Created March 28, 2023 01:08
pipeline-jobdsl-github
folder('operations') {
displayName('operations')
description('Operations related all Jobs')
}
folder('operations/sre') {
displayName('operations-sre')
description('Operations related all Jobs for sre')
}
@parjun8840
parjun8840 / embedded-script-job-dsl
Created March 28, 2023 01:06
embedded-script-job-dsl
folder('operations') {
displayName('operations')
description('Operations related all Jobs')
}
folder('operations/sre') {
displayName('operations-sre')
description('Operations related all Jobs for sre')
}
@parjun8840
parjun8840 / basic_pipeline_env_credentials
Last active March 25, 2023 03:01
basic_pipeline_env_credentials
def friends_name = ["TOM", "JACk", "HARRY"]
pipeline{
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
@parjun8840
parjun8840 / basic01
Created March 23, 2023 01:38
basic01- k8s pods list
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: kubectl-image
image: alpine/k8s:1.24.12
@parjun8840
parjun8840 / basic-job-maven
Last active March 22, 2023 23:31
basic-job-maven
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
image: maven:alpine