Skip to content

Instantly share code, notes, and snippets.

@igouss
igouss / Dockerfile
Last active September 8, 2022 17:06
Flyway migration for postgrest database
# To build locally:
# docker build -t xm-database-postgress .
FROM eclipse-temurin:11 as JDK
# use the same version of flyway in build.gradle
FROM flyway/flyway:6.2.4 as flyway
# Replace with your base PG image here:
FROM XXXXXourBasePostgresImageXXXXXXXX:14.3 as database
ENV JAVA_HOME=/opt/jdk
@igouss
igouss / gist:823e5de9592e7cdb568d1acddde2f5bf
Created July 29, 2021 20:53
Gradle execute SQL script in Postgresql database
import groovy.sql.Sql
task dropDatabase {
doLast {
Class.forName("org.postgresql.Driver")
def sql = groovy.sql.Sql.newInstance(
"jdbc:postgresql://localhost:5432/",
${DBA_USER},
${DBA_PASSWORD},
"org.postgresql.Driver"
@igouss
igouss / gist:cd91d46d1990bfed011adaecfe331cf4
Last active April 1, 2021 20:42
Project local maven repo in gradle, load jars
gradle.build
```
repositories {
maven { url "file:libs" }
maven { url "${nexus}" }
}
implementation "com.xmatters.springboot.common:exceptions:1.246.0",
@igouss
igouss / gist:be06fa12cb757b26e275a57b4dcfbd6d
Created March 31, 2021 22:14
gradle Export jar files
task exportApiServiceParametersJar(type : Jar) {
from { sourceSets.main.output.classesDirs } {
include "com/foo/api/service/parameters/**"
}
dependsOn compileJava
}
task exportApiPagingJar(type : Jar) {
from { sourceSets.main.output.classesDirs } {
include "com/foo/api/paging/**"
}
@igouss
igouss / gist:48be48d65fc33295b58b90cab2894930
Created October 23, 2020 21:32
Spring boot properties Map of Sets
@Value("#{${deny.shift}}") Map<UUID, Set<UUID>> denyShiftsList
deny.shift={'044057a6-1380-4ec8-b0f0-25cf638927bd': {'542e3319-1186-446c-9c1a-b1892bcc5243'} }
@igouss
igouss / ObservableQuery.java
Created September 22, 2015 22:12
RxJava and Hibernate Scrollable query Raw
package com.naxsoft.database;
import org.hibernate.Query;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.StatelessSession;
import rx.Observable;
/**
* Copyright NAXSoft 2015