Skip to content

Instantly share code, notes, and snippets.

@mroger
mroger / Jenkinsfile
Created May 13, 2019
Jenkinsfile snippet #1
View Jenkinsfile
env.headTag = sh(returnStdout: true, script: 'git describe --all --exact-match `git rev-parse HEAD`').trim()
echo env.headTag
if (headTag =~ /^tags\/v\d+.\d+.\d+/) {
currentBuild.result = 'ABORTED'
error 'Ignoring build because there are no new changes'
}
@mroger
mroger / Jenkinsfile
Last active May 13, 2019
Jenkins file
View Jenkinsfile
pipeline {
agent any
options {
disableConcurrentBuilds()
}
stages {
stage('Checkout') {
steps {
deleteDir()
@mroger
mroger / settings.gradle
Last active May 12, 2019
Settings gradle configuring semantic version plugin
View settings.gradle
pluginManagement {
repositories {
gradlePluginPortal()
}
}
rootProject.name = 'semantic-version'
buildscript {
repositories {
@mroger
mroger / semantic-build-versioning.gradle
Created May 12, 2019
Configuring semantic build versioning
View semantic-build-versioning.gradle
startingVersion = '1.0.0'
tagPrefix = 'v'
@mroger
mroger / build.gradle
Created May 11, 2019
Simple Gradle build
View build.gradle
plugins {
id 'org.springframework.boot' version '2.1.4.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
group = 'br.org.roger.springboot'
sourceCompatibility = '1.8'
@mroger
mroger / docker-compose.yml
Created Jul 19, 2018
docker-compose file
View docker-compose.yml
version: '3'
services:
mysql:
image: mysql:5.7.22
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=TIMESHEET
liquibase:
@mroger
mroger / entrypoint.sh
Created Jul 17, 2018
Docker container entrypoint
View entrypoint.sh
#!/bin/bash
git fetch --all
git reset --hard origin/master
mvn package
mvn liquibase:update -Dliquibase-database-password=root
@mroger
mroger / Dockerfile
Created Jul 16, 2018
Dockerfile reponsible for making the image for executing liquibase migrations
View Dockerfile
FROM ubuntu-jdk8-dev:latest
ENV LIQUIBASE_PROJECT_DIR=${LIQUIBASE_PROJECT_DIR:-.}\
LIQUIBASE_DATABASE_DRIVER=${LIQUIBASE_DATABASE_DRIVER:-com.mysql.cj.jdbc.Driver}\
LIQUIBASE_DATABASE_URL=${LIQUIBASE_DATABASE_URL:-jdbc:mysql://localhost:3306/TIMESHEET}\
LIQUIBASE_DATABASE_USERNAME=${LIQUIBASE_DATABASE_USERNAME:-root}\
LIQUIBASE_DATABASE_PASSWORD=${LIQUIBASE_DATABASE_PASSWORD:-root}
ADD ${LIQUIBASE_PROJECT_DIR} /usr/local/ubuntu-jdk8-liquibase
@mroger
mroger / Dockerfile
Created Jul 14, 2018
Dockerfile for ubuntu-jdk8-dev
View Dockerfile
FROM ubuntu-jdk8:latest
RUN apt-get update && apt-get install -y maven git
@mroger
mroger / Dockerfile
Created Jul 14, 2018
Dockerfile for ubuntu-jdk8 image
View Dockerfile
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y python-software-properties software-properties-common
RUN apt-get install -y iputils-ping
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get install -y vim
RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" | debconf-set-selections
RUN apt-get update && apt-get install -y oracle-java8-installer