Skip to content

Instantly share code, notes, and snippets.

const fetch = require('node-fetch');
const fs = require('fs');
const csv = require('csv-parser');
const csvFilePath = 'CSV TEMPLATE';
const apiEndpoint = 'CUSTOMER SPECIFIC INCIDENTS SYNC ENDPOINT';
const apiKey = 'API KEY';
fs.createReadStream(csvFilePath)
const axios = require('axios');
exports.handler = async (event) => {
console.log(event);
console.log('Received event:', JSON.stringify(event, null, 2));
// Log key-value pairs
Object.entries(event).forEach(([key, value]) => {
console.log(`${key}: ${value}`);
curl -X POST https://i0sv0dqkzk.execute-api.us-east-1.amazonaws.com/Prod/cirrus-webhook \
-H "Content-Type: application/json" \
-d '{
"buildConfigurationName": "main-app-build",
"taskId": "CirrusCIabcde12345678",
"buildCreatedTimestamp": "2024-08-19T14:30:00Z",
"buildStatus": "SUCCESS",
"buildFinishedTimestamp": "2024-08-19T15:00:00Z",
"repository": "my-org/my-repo",
"commitSha": "a1b2c3d4e5f67890abcdef1234567890",
const axios = require('axios');
exports.handler = async (event) => {
console.log(event);
console.log('Received event:', JSON.stringify(event, null, 2));
// Log key-value pairs
Object.entries(event).forEach(([key, value]) => {
console.log(`${key}: ${value}`);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"time"
curl -X POST http://localhost:8080/webhook \
-H "Content-Type: application/json" \
-H "X-Gitlab-Event: Pipeline Hook" \
-H "X-Gitlab-Token: your_gitlab_token" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"id": 32,
"iid": 4,
"ref": "main",
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Bash@3
inputs:
targetType: 'inline'
@Sdy603
Sdy603 / fetch_jira_incidents_and_POST_incidents_API.js
Last active September 25, 2024 19:54 — forked from ivansnag/fetch_jira_incidents_and_POST_incidents_API.js
Fetches JIRA incidents from DB and POSTs to the Incidents API
const { Client } = require('pg');
const axios = require('axios');
// Set debug mode
const debug = true; // Set to false to make actual API calls
// Database connection string
const connectionString = [CONNECTION STRING FROM DX]
// Create a new PostgreSQL client
@Sdy603
Sdy603 / incidents.groovy
Last active September 25, 2024 19:56
Groovy Incidents Import
@Grab(group='org.postgresql', module='postgresql', version='42.2.5')
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
import groovy.sql.Sql
import groovyx.net.http.RESTClient
import groovy.json.JsonOutput
// Set debug mode
def debug = true // Set to false to make actual API calls
@Sdy603
Sdy603 / CustomProperties.py
Created September 30, 2024 19:03
This is used to pull custom repo properties from GitHub and send them to DX.
import os
import json
import requests
import psycopg2
from datetime import datetime
def lambda_handler(event, context):
# GitHub API URL for custom properties
repo_owner = os.getenv("REPO_OWNER")
repo_name = os.getenv("REPO_NAME")