Skip to content

Instantly share code, notes, and snippets.

View ealebed's full-sized avatar

Yevhen Lebid ealebed

View GitHub Profile
@ealebed
ealebed / gist:b9942f227bba1148cabb769ae4129794
Created March 20, 2024 07:23
example reverse proxy VM for datastream
# Proxy VM
resource "google_compute_instance" "reverse-proxy" {
project = var.project # app-ref project
name = "reverse-proxy"
machine_type = "e2-medium"
zone = "asia-southeast1-b"
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
@ealebed
ealebed / main.go
Created July 17, 2022 08:56
Count time to date/time in future
package main
import (
"fmt"
"time"
)
func main() {
loc, _ := time.LoadLocation("Europe/Kiev")
now := time.Now().In(loc)
@ealebed
ealebed / Dockerfile
Last active August 26, 2021 11:13
Apache Airflow with custom healthcheck
FROM python:3.9-slim-buster
LABEL maintainer="Yevhen Lebid <yevhen.lebid@loopme.com>"
# Never prompts the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND=noninteractive \
TERM=linux
# Airflow
ARG AIRFLOW_VERSION=2.1.2
@ealebed
ealebed / 000_templated_task.py
Created May 22, 2021 07:32
Trigger KubernetesPodOperator using HTTP call
import airflow
from airflow.models import DAG
from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator
from kubernetes.client import models as k8s
default_args = {
'owner': 'ealebed',
'depends_on_past': False,
'start_date': airflow.utils.dates.days_ago(0),
@ealebed
ealebed / FlywayMigrationTest.java
Created February 5, 2021 13:27
For flyway-validation-example
package com.loopme.db;
import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
@Testcontainers
public class FlywayMigrationTest {
@ealebed
ealebed / Jenkinsfile.validate
Created March 27, 2020 10:10
Flyway migration validations (free, open-source version)
pipeline {
agent any
stages {
stage("Prepare environment") {
steps {
script {
sh "docker-compose -f docker-compose.yaml down --remove-orphans --volumes"
}
}
@ealebed
ealebed / checkstyle.gradle
Created February 6, 2020 09:19
Gradle checkstyleOnlyChangedFiles task
import java.nio.file.Paths
plugins {
id 'checkstyle'
}
checkstyleMain {
source = 'src/main/java'
}
checkstyleTest {
@ealebed
ealebed / Dockerfile
Last active April 13, 2021 04:40
Airflow_Kubernetes
FROM python:3.7-slim-stretch
LABEL maintainer="Yevhen Lebid <yevhen.lebid@loopme.com>"
# Never prompts the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND=noninteractive \
TERM=linux
# Airflow
ARG AIRFLOW_VERSION=1.10.7
@ealebed
ealebed / create-jobs.groovy
Last active December 20, 2023 03:45
Groovy script for creating Jenkins job from .yaml file
@Grab(group='org.yaml', module='snakeyaml', version='1.18')
import jenkins.model.*
import hudson.model.*
import hudson.triggers.*
import hudson.tasks.LogRotator
import hudson.plugins.git.*
import hudson.plugins.git.extensions.*
import hudson.plugins.git.extensions.impl.*
import org.jenkinsci.plugins.workflow.job.WorkflowJob
import org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition