This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
- main | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- task: Bash@3 | |
inputs: | |
targetType: 'inline' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
OlderNewer