Skip to content

Instantly share code, notes, and snippets.

View PrashantBhatasana's full-sized avatar
🎯
Focusing

Bhatasana Prashant PrashantBhatasana

🎯
Focusing
View GitHub Profile
@PrashantBhatasana
PrashantBhatasana / ReadSpreadsheet.groovy
Last active October 3, 2019 06:00
This is a groovy file to connect google sheet API and read data from googlesheet. https://medium.com/appgambit/integrating-google-sheet-with-katalon-studio-f72936511c27
package com.java.utilily
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.google.api.client.util.store.FileDataStoreFactory
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.checkpoint.Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory
@PrashantBhatasana
PrashantBhatasana / Jenkinsfile
Last active August 26, 2021 15:35
This is the Jenkins file for building React Navite application.
def err = null
try {
node {
stage('Preparation') {
git credentialsId: 'fef4159e-285b-45d9-80ca-5981c4576ba5', url: 'https://github.com/prashant-bhatasana/demoApp/'
}
stage('Dependencies') {
@PrashantBhatasana
PrashantBhatasana / AnsiblePlaybookDemo
Last active November 7, 2019 08:41
This is a Demo Ansible playbook script to pull the latest changes and install new dependences with PM2 start and stop.
---
- name: ANSIBLE - Configure Node server
hosts: SampleApp-Server
become: true
become_method: sudo
become_user: nodejs
vars:
node_version: 6.9.1
@PrashantBhatasana
PrashantBhatasana / Jenkinsfile
Created November 14, 2019 10:41
This is Demo Jenkinsfile for Slack integration.
def err = null
try {
node {
stage('Start Notification') {
slackSend baseUrl: 'https://prashant-bhatasana.slack.com/services/hooks/jenkins-ci/', channel: '#test_notification', color: 'Green', failOnError: true, message: " Android build pipeline - '${env.BUILD_NUMBER}' -- $STAGE ", teamDomain: 'https://prashant-bhatasana.slack.com', tokenCredentialId: '7ca00656-3323-7789-9b1a-e2c836b9a73f'
}
<<<<<<<<<<<<<<<<< Add your Pipeline Script here >>>>>>>>>>>>>>>>>
}
@PrashantBhatasana
PrashantBhatasana / Jenkinsfile
Last active December 14, 2019 10:22
This is a Jenkinsfile for build NodeJS application build with Jenmins.
pipeline {
agent any
tools {nodejs "node"}
stages {
stage('Git') {
steps {
git 'https://github.com/****/****'
@PrashantBhatasana
PrashantBhatasana / bitbucket-pipelines.yml
Last active December 24, 2019 13:19
This is the bitbucket pipelines yml file.
image: lambci/lambda:build-nodejs6.10
pipelines:
default:
- step:
name: Build and package
script:
- apt-get update && apt-get install -y zip
- npm install
- npm install node-lambda -g
@PrashantBhatasana
PrashantBhatasana / slack_notification_lambda_function.py
Last active January 10, 2020 07:16
This is lambda function with python language that start ec2 instence as well as send notification to slack...
import boto3
import time
from botocore.vendored import requests
region = 'us-XXXX-2'
instances = ['i-XXXXXXXXXXXXXXXXXX']
url = "https://hooks.slack.com/services/TBCS4ARD2/KKHJSBBBD/fdDFQxOHNpMLnb9z7FpVCLM6"
payload = "{
\n\t\"channel\": \"#aws notification\", <Enter slack channel name>
@PrashantBhatasana
PrashantBhatasana / start_instances_lambda_function.py
Last active January 10, 2020 07:16
This is lambda function with python language that start ec2 instence.
import boto3
import time
region = 'us-XXXX-2'
instances = ['i-XXXXXXXXXXXXXXXX']
def lambda_handler(event, context):
ec2 = boto3.client('ec2', region_name=region)
ec2.start_instances(InstanceIds=instances)
print 'started your instances: ' + str(instances)
@PrashantBhatasana
PrashantBhatasana / stop_instances_lambda_function.py
Last active January 10, 2020 07:16
This is lambda function with python language that stop ec2 instence.
import boto3
import time
region = 'us-XXXX-2'
instances = ['i-XXXXXXXXXXXXXXXX']
def lambda_handler(event, context):
ec2 = boto3.client('ec2', region_name=region)
ec2.stop_instances(InstanceIds=instances)
print 'started your instances: ' + str(instances)
@PrashantBhatasana
PrashantBhatasana / create_instances_lambda_function.py
Last active May 26, 2021 14:20
This is lambda function with python language that create ec2 instence.
import os
import boto3
AMI = os.environ['AMI']
INSTANCE_TYPE = os.environ['INSTANCE_TYPE']
KEY_NAME = os.environ['KEY_NAME']
SUBNET_ID = os.environ['SUBNET_ID']
REGION = os.environ['REGION']
ec2 = boto3.client('ec2', region_name=REGION)